rdblue commented on code in PR #5601:
URL: https://github.com/apache/iceberg/pull/5601#discussion_r953159807
##########
api/src/main/java/org/apache/iceberg/transforms/Bucket.java:
##########
@@ -90,6 +96,11 @@ public Integer apply(T value) {
return (hash(value) & Integer.MAX_VALUE) % numBuckets;
}
+ @Override
+ public boolean canTransform(Type type) {
+ return type.isPrimitiveType();
Review Comment:
I think this is correct because it is whether the transform can be applied
to a type, not whether the current instance of that transform can be applied to
a type. This is used to validate partition specs, sort orders, and bound
functions that contain transforms. When we know the concrete type, we check
whether the transform can handle it.
Before, we would get the final transform at the point just before that
check, when the type was known. That was basically using
`Transform.fromString(actualType, transform.toString())` to rebuild the
transform and then it would call `canTransform`. Now the same generic transform
can be used and `canTransform` doesn't need a specific transform instance.
--
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]