aokolnychyi commented on code in PR #5601:
URL: https://github.com/apache/iceberg/pull/5601#discussion_r953066886
##########
api/src/main/java/org/apache/iceberg/transforms/Bucket.java:
##########
@@ -159,111 +172,53 @@ public Type getResultType(Type sourceType) {
return Types.IntegerType.get();
}
- private static class BucketInteger extends Bucket<Integer> {
+ private static class BucketInteger extends Bucket<Integer> implements
Function<Integer, Integer> {
private BucketInteger(int numBuckets) {
super(numBuckets);
}
@Override
- public int hash(Integer value) {
+ protected int hash(Integer value) {
return BucketUtil.hash(value);
}
-
- @Override
- public boolean canTransform(Type type) {
- return type.typeId() == TypeID.INTEGER || type.typeId() == TypeID.DATE;
- }
}
- private static class BucketLong extends Bucket<Long> {
+ private static class BucketLong extends Bucket<Long> implements
Function<Long, Integer> {
Review Comment:
Are these functions supposed to be serializable?
--
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]