EdwinGuo commented on a change in pull request #1466: [HUDI-742] Fix Java Math
Exception
URL: https://github.com/apache/incubator-hudi/pull/1466#discussion_r400598791
##########
File path:
hudi-client/src/test/java/org/apache/hudi/index/bloom/TestBucketizedBloomCheckPartitioner.java
##########
@@ -79,4 +80,20 @@ public void testNumPartitions() {
BucketizedBloomCheckPartitioner p = new
BucketizedBloomCheckPartitioner(10000, comparisons1, 10);
assertEquals("num partitions must equal total buckets", 100,
p.numPartitions());
}
+
+ @Test
+ public void testGetPartitions() {
+ Map<String, Long> comparisons1 = new HashMap<String, Long>() {
+ {
+ IntStream.range(0, 100000).forEach(f -> put("f" + f, 100L));
+ }
+ };
+ BucketizedBloomCheckPartitioner p = new
BucketizedBloomCheckPartitioner(1000, comparisons1, 10);
+
+ IntStream.range(0, 100000).forEach(f -> {
+ int partition = p.getPartition(Pair.of("f" + f, "value"));
+ assertTrue("partition is within of range: " + partition, 0 <= partition
&& partition <= 1000);
Review comment:
updated. Thanks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services