boneanxs commented on code in PR #7571:
URL: https://github.com/apache/hudi/pull/7571#discussion_r1059217632


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/index/bloom/TestKeyRangeLookupTree.java:
##########
@@ -68,7 +68,7 @@ public void 
testFileGroupLookUpManyEntriesWithSameStartValue() {
     updateExpectedMatchesToTest(toInsert);
     keyRangeLookupTree.insert(toInsert);
     for (int i = 0; i < 10; i++) {
-      endKey += 1 + RANDOM.nextInt(100);
+      endKey += 1 + RANDOM.nextInt(50);
       toInsert = new KeyRangeNode(startKey, Long.toString(endKey), 
UUID.randomUUID().toString());
       updateExpectedMatchesToTest(toInsert);

Review Comment:
   As `KeyRangeNode` stores recordValue, which is always string value, 
`KeyRangeNode` doesn't need to compare with other type. I think the test 
purpose here wants to use Long's order to represent string's order to test 
`KeyRangeNode` function, so it can work if we force the `endKey` not exceed 
1000.
   
   Before the fix, the endKey's maxValue could be 101 * 10 + 250 = 1260, which 
can exceed 1000. As I forcily set `RANDOM` cannot get value exceed than 50 for 
each iteration, and the max iteration number is 10, so the endKey cannot exceed 
51 * 10 + 250(which is 760), smaller than 1000, so in this range, Long's order 
is same as the string's order.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to