Skip to content

Commit

Permalink
Rebase on main
Browse files Browse the repository at this point in the history
  • Loading branch information
Walaa Eldin Moustafa committed Aug 21, 2024
1 parent 7d622c4 commit a0792d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/src/main/java/org/apache/iceberg/types/Types.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public NestedField withWriteDefault(Object newWriteDefault) {
}

public NestedField withFieldId(int newId) {
return new NestedField(isOptional, newId, name, type, doc);
return new NestedField(isOptional, newId, name, type, doc, initialDefault, writeDefault);
}

public int fieldId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class TestReadDefaultValues {

@Rule public TemporaryFolder temp = new TemporaryFolder();

private static final Object[][] typesWithDefaults =
private static final Object[][] TYPES_WITH_DEFAULTS =
new Object[][] {
{Types.BooleanType.get(), "true"},
{Types.IntegerType.get(), "1"},
Expand Down Expand Up @@ -110,7 +110,7 @@ public class TestReadDefaultValues {

@Test
public void testDefaultValueApplied() throws IOException {
for (Object[] typeWithDefault : typesWithDefaults) {
for (Object[] typeWithDefault : TYPES_WITH_DEFAULTS) {
Type type = (Type) typeWithDefault[0];
String defaultValueJson = (String) typeWithDefault[1];
Object defaultValue = SingleValueParser.fromJson(type, defaultValueJson);
Expand Down Expand Up @@ -155,7 +155,7 @@ public void testDefaultValueApplied() throws IOException {

@Test
public void testDefaultValueNotApplied() throws IOException {
for (Object[] typeWithDefault : typesWithDefaults) {
for (Object[] typeWithDefault : TYPES_WITH_DEFAULTS) {
Type type = (Type) typeWithDefault[0];
String defaultValueJson = (String) typeWithDefault[1];
Object defaultValue = SingleValueParser.fromJson(type, defaultValueJson);
Expand Down

0 comments on commit a0792d5

Please sign in to comment.