Fokko commented on code in PR #11868:
URL: https://github.com/apache/iceberg/pull/11868#discussion_r2178303855
##########
api/src/main/java/org/apache/iceberg/PartitionSpec.java:
##########
@@ -132,6 +132,12 @@ public StructType partitionType() {
for (PartitionField field : fields) {
Type sourceType = schema.findType(field.sourceId());
Type resultType = field.transform().getResultType(sourceType);
+
+ // When the source field has been dropped we cannot determine the
type
+ if (resultType == null) {
Review Comment:
It cannot be `null` because that will raise an exception when constructing
the `StructType` below: `Types.StructType.of(structFields);`. Just filtering is
not allowed, since for V1 we have to maintain the position of the fields,
therefore injecting a `NullType` feels to me the safest approach. Since the
field is not part of the active partition spec, it won't be used anymore, so I
think we're good.
--
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]