RussellSpitzer commented on a change in pull request #3411:
URL: https://github.com/apache/iceberg/pull/3411#discussion_r815213896
##########
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()) &&
+ !Transforms.alwaysNull().equals(field.transform())) {
+ fieldMap.put(fieldId, field);
+ NestedField structField = spec.partitionType().field(fieldId);
+ structFields.set(fieldToIndex.get(fieldId), structField);
Review comment:
ok got it, we need the "spec.partitionType()" of the spec the partition
field was created with, and at this point we have lost that reference
--
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]