RussellSpitzer commented on code in PR #17808:
URL: https://github.com/apache/iceberg/pull/17808#discussion_r3854309702
##########
api/src/main/java/org/apache/iceberg/types/AssignFreshIds.java:
##########
@@ -74,21 +83,28 @@ public Type schema(Schema schema, Supplier<Type> future) {
@Override
public Type struct(Types.StructType struct, Iterable<Type> futures) {
+ if (struct.isFileType()) {
+ // nested fields are rebuilt from the new id assigned to the field that
holds this type
+ return struct;
+ }
+
List<Types.NestedField> fields = struct.fields();
int length = struct.fields().size();
// assign IDs for this struct's fields first
List<Integer> newIds = Lists.newArrayListWithExpectedSize(length);
for (int i = 0; i < length; i += 1) {
- newIds.add(idFor(name(fields.get(i).fieldId())));
+ Types.NestedField field = fields.get(i);
+ newIds.add(idFor(name(field.fieldId()), field.type()));
Review Comment:
We have to start plumbing "Type" through again to handle "file" types
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]