danny0405 commented on code in PR #6636:
URL: https://github.com/apache/hudi/pull/6636#discussion_r979340081
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/BucketIdentifier.java:
##########
@@ -42,6 +50,20 @@ public static int getBucketId(HoodieKey hoodieKey, String
indexKeyFields, int nu
return (getHashKeys(hoodieKey, indexKeyFields).hashCode() &
Integer.MAX_VALUE) % numBuckets;
}
+ public static int getRangeBucketNum(String recordKey, int
bucketRangeStepSize) {
+ int index = recordKey.indexOf(":");
+ if (index >= 0) {
+ recordKey = recordKey.substring(index + 1);
+ }
+ try {
+ int bucketNum = (int) (Long.parseLong(recordKey) / bucketRangeStepSize);
+ return bucketNum;
+ } catch (Exception e) {
+ LOG.error("RANGE_BUCKET index need a primary key like Interger.", e);
+ throw e;
Review Comment:
`need a primary key like Interger` -> `needs integer type primary key`
--
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]