Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 379154b

Browse files
committed
Use ImmutableList.Builder in CheckpointSchemaManager
1 parent c155a3e commit 379154b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointSchemaManager.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ public RowType getAddEntryType(MetadataEntry metadataEntry)
137137
RowType.from(allColumns.stream().map(column -> buildNullCountType(Optional.of(column.getPhysicalName()), column.getPhysicalColumnType())).collect(toImmutableList()))));
138138

139139
MapType stringMap = (MapType) typeManager.getType(TypeSignature.mapType(VarcharType.VARCHAR.getTypeSignature(), VarcharType.VARCHAR.getTypeSignature()));
140-
List<RowType.Field> addFields = ImmutableList.of(
141-
RowType.field("path", VarcharType.createUnboundedVarcharType()),
142-
RowType.field("partitionValues", stringMap),
143-
RowType.field("size", BigintType.BIGINT),
144-
RowType.field("modificationTime", BigintType.BIGINT),
145-
RowType.field("dataChange", BooleanType.BOOLEAN),
146-
RowType.field("stats", VarcharType.createUnboundedVarcharType()),
147-
RowType.field("stats_parsed", RowType.from(statsColumns.build())),
148-
RowType.field("tags", stringMap));
149-
150-
return RowType.from(addFields);
140+
ImmutableList.Builder<RowType.Field> addFields = ImmutableList.builder();
141+
addFields.add(RowType.field("path", VarcharType.createUnboundedVarcharType()));
142+
addFields.add(RowType.field("partitionValues", stringMap));
143+
addFields.add(RowType.field("size", BigintType.BIGINT));
144+
addFields.add(RowType.field("modificationTime", BigintType.BIGINT));
145+
addFields.add(RowType.field("dataChange", BooleanType.BOOLEAN));
146+
addFields.add(RowType.field("stats", VarcharType.createUnboundedVarcharType()));
147+
addFields.add(RowType.field("stats_parsed", RowType.from(statsColumns.build())));
148+
addFields.add(RowType.field("tags", stringMap));
149+
150+
return RowType.from(addFields.build());
151151
}
152152

153153
private static RowType.Field buildNullCountType(Optional<String> columnName, Type columnType)

0 commit comments

Comments
 (0)