RussellSpitzer commented on a change in pull request #3411:
URL: https://github.com/apache/iceberg/pull/3411#discussion_r813388654
##########
File path: core/src/main/java/org/apache/iceberg/Partitioning.java
##########
@@ -228,11 +229,22 @@ public static StructType partitionType(Table table) {
fieldMap.put(fieldId, field);
NestedField structField = spec.partitionType().field(fieldId);
structFields.add(structField);
+
+ if (Transforms.alwaysNull().equals(field.transform())) {
+ fieldToIndex.put(fieldId, structFields.size() - 1);
+ }
} else {
// verify the fields are compatible as they may conflict in v1 tables
ValidationException.check(equivalentIgnoringNames(field,
existingField),
"Conflicting partition fields: ['%s', '%s']",
field, existingField);
+
+ if (Transforms.alwaysNull().equals(existingField.transform()) &&
Review comment:
I think we should add a comment here,
"Void Transforms always revert back to the Type of the original column being
transformed. This will lead to type errors when analyzing partition fields
written for earlier files with a different type. To avoid this we always
restore NullTransforms to their previous non-null state."
Or something like that?
--
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]