Skip to content

Commit f21f15e

Browse files
imjalpreetaditi-pandit
authored andcommitted
[iceberg] Make com.facebook.presto.iceberg.PrestoIcebergSchema.aliases not null
1 parent cefb7ab commit f21f15e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

presto-iceberg/src/main/java/com/facebook/presto/iceberg/PrestoIcebergSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public PrestoIcebergSchema(
4545
this.schemaId = schemaId;
4646
this.columns = ImmutableList.copyOf(requireNonNull(columns, "columns is null"));
4747
this.columnNameToIdMapping = ImmutableMap.copyOf(requireNonNull(columnNameToIdMapping, "columnNameToIdMapping is null"));
48-
this.aliases = aliases != null ? ImmutableMap.copyOf(aliases) : null;
48+
this.aliases = aliases != null ? ImmutableMap.copyOf(aliases) : ImmutableMap.of();
4949
this.identifierFieldIds = ImmutableSet.copyOf(requireNonNull(identifierFieldIds, "identifierFieldIds is null"));
5050
}
5151

presto-iceberg/src/main/java/com/facebook/presto/iceberg/SchemaConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static Schema toIcebergSchema(PrestoIcebergSchema schema)
4545
schema.getColumns().stream()
4646
.map(nestedField -> toIcebergNestedField(nestedField, schema.getColumnNameToIdMapping()))
4747
.collect(toImmutableList()),
48-
schema.getAliases(),
48+
schema.getAliases().isEmpty() ? null : schema.getAliases(),
4949
schema.getIdentifierFieldIds());
5050
}
5151
}

0 commit comments

Comments
 (0)