Skip to content

Commit 4d27522

Browse files
committed
Remove redundant types qualification for NestedField and PrimitiveType
1 parent e63dbac commit 4d27522

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
import org.apache.iceberg.io.LocationProvider;
7676
import org.apache.iceberg.types.Type.PrimitiveType;
7777
import org.apache.iceberg.types.TypeUtil;
78-
import org.apache.iceberg.types.Types;
7978
import org.apache.iceberg.types.Types.NestedField;
8079
import org.apache.iceberg.types.Types.StructType;
8180

@@ -486,19 +485,19 @@ public static Map<PartitionField, Integer> getIdentityPartitions(PartitionSpec p
486485
return columns.buildOrThrow();
487486
}
488487

489-
public static List<Types.NestedField> primitiveFields(Schema schema)
488+
public static List<NestedField> primitiveFields(Schema schema)
490489
{
491490
return primitiveFields(schema.columns())
492491
.collect(toImmutableList());
493492
}
494493

495-
private static Stream<Types.NestedField> primitiveFields(List<NestedField> nestedFields)
494+
private static Stream<NestedField> primitiveFields(List<NestedField> nestedFields)
496495
{
497496
return nestedFields.stream()
498497
.flatMap(IcebergUtil::primitiveFields);
499498
}
500499

501-
private static Stream<Types.NestedField> primitiveFields(NestedField nestedField)
500+
private static Stream<NestedField> primitiveFields(NestedField nestedField)
502501
{
503502
org.apache.iceberg.types.Type type = nestedField.type();
504503
if (type.isPrimitiveType()) {
@@ -507,7 +506,7 @@ private static Stream<Types.NestedField> primitiveFields(NestedField nestedField
507506

508507
if (type.isNestedType()) {
509508
return primitiveFields(type.asNestedType().fields())
510-
.map(field -> Types.NestedField.from(field).withName(nestedField.name() + "." + field.name()).build());
509+
.map(field -> NestedField.from(field).withName(nestedField.name() + "." + field.name()).build());
511510
}
512511

513512
throw new IllegalStateException("Unsupported field type: " + nestedField);
@@ -1284,11 +1283,11 @@ public static Optional<IcebergPartitionColumn> getPartitionColumnType(List<Parti
12841283

12851284
public static List<org.apache.iceberg.types.Type> partitionTypes(
12861285
List<PartitionField> partitionFields,
1287-
Map<Integer, org.apache.iceberg.types.Type.PrimitiveType> idToPrimitiveTypeMapping)
1286+
Map<Integer, PrimitiveType> idToPrimitiveTypeMapping)
12881287
{
12891288
ImmutableList.Builder<org.apache.iceberg.types.Type> partitionTypeBuilder = ImmutableList.builder();
12901289
for (PartitionField partitionField : partitionFields) {
1291-
org.apache.iceberg.types.Type.PrimitiveType sourceType = idToPrimitiveTypeMapping.get(partitionField.sourceId());
1290+
PrimitiveType sourceType = idToPrimitiveTypeMapping.get(partitionField.sourceId());
12921291
org.apache.iceberg.types.Type type = partitionField.transform().getResultType(sourceType);
12931292
partitionTypeBuilder.add(type);
12941293
}

0 commit comments

Comments
 (0)