nandorKollar commented on code in PR #14266:
URL: https://github.com/apache/iceberg/pull/14266#discussion_r2543709096


##########
core/src/main/java/org/apache/iceberg/SchemaUpdate.java:
##########
@@ -280,8 +301,17 @@ public UpdateSchema updateColumn(String name, 
Type.PrimitiveType newType) {
       return this;
     }
 
+    // If field is listed in source-ids, we need to flag it for promoting date 
-> timestamp.
+    List<PartitionField> partitionFields =
+        this.base != null
+            ? this.base.spec().getFieldsBySourceId(field.fieldId())
+            : Lists.newArrayList();
+
+    boolean isBucketPartitioned =
+        partitionFields.stream().anyMatch(pf -> 
pf.transform().toString().startsWith("bucket["));

Review Comment:
   If we would like to keep the original idea, and filter for bucket 
transformation here, then how about this: we introduce a new method to 
`Transform` interface, with a default implementation, which we can use to tell, 
if the given transformation allows a certain type promotion request? The 
default method allows everything, regardless of source and target types, while 
the bucket transformation will reject date promotion. If this is a breaking 
change (due to the default method it shouldn't), then we can introduce a new 
interface for it, with the same check method, and call it only when the given 
transformation implements it (of course bucket will). How does this sound?



-- 
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]

Reply via email to