Skip to content

Commit 4c0b43f

Browse files
committed
Remove redundant types qualification for NestedField and PrimitiveType
1 parent a8410e8 commit 4c0b43f

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

@@ -480,19 +479,19 @@ public static Map<PartitionField, Integer> getIdentityPartitions(PartitionSpec p
480479
return columns.buildOrThrow();
481480
}
482481

483-
public static List<Types.NestedField> primitiveFields(Schema schema)
482+
public static List<NestedField> primitiveFields(Schema schema)
484483
{
485484
return primitiveFields(schema.columns())
486485
.collect(toImmutableList());
487486
}
488487

489-
private static Stream<Types.NestedField> primitiveFields(List<NestedField> nestedFields)
488+
private static Stream<NestedField> primitiveFields(List<NestedField> nestedFields)
490489
{
491490
return nestedFields.stream()
492491
.flatMap(IcebergUtil::primitiveFields);
493492
}
494493

495-
private static Stream<Types.NestedField> primitiveFields(NestedField nestedField)
494+
private static Stream<NestedField> primitiveFields(NestedField nestedField)
496495
{
497496
org.apache.iceberg.types.Type type = nestedField.type();
498497
if (type.isPrimitiveType()) {
@@ -501,7 +500,7 @@ private static Stream<Types.NestedField> primitiveFields(NestedField nestedField
501500

502501
if (type.isNestedType()) {
503502
return primitiveFields(type.asNestedType().fields())
504-
.map(field -> Types.NestedField.from(field).withName(nestedField.name() + "." + field.name()).build());
503+
.map(field -> NestedField.from(field).withName(nestedField.name() + "." + field.name()).build());
505504
}
506505

507506
throw new IllegalStateException("Unsupported field type: " + nestedField);
@@ -1252,11 +1251,11 @@ public static Optional<IcebergPartitionColumn> getPartitionColumnType(List<Parti
12521251

12531252
public static List<org.apache.iceberg.types.Type> partitionTypes(
12541253
List<PartitionField> partitionFields,
1255-
Map<Integer, org.apache.iceberg.types.Type.PrimitiveType> idToPrimitiveTypeMapping)
1254+
Map<Integer, PrimitiveType> idToPrimitiveTypeMapping)
12561255
{
12571256
ImmutableList.Builder<org.apache.iceberg.types.Type> partitionTypeBuilder = ImmutableList.builder();
12581257
for (PartitionField partitionField : partitionFields) {
1259-
org.apache.iceberg.types.Type.PrimitiveType sourceType = idToPrimitiveTypeMapping.get(partitionField.sourceId());
1258+
PrimitiveType sourceType = idToPrimitiveTypeMapping.get(partitionField.sourceId());
12601259
org.apache.iceberg.types.Type type = partitionField.transform().getResultType(sourceType);
12611260
partitionTypeBuilder.add(type);
12621261
}

0 commit comments

Comments
 (0)