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_r400260629
 
 

 ##########
 File path: 
hudi-client/src/main/java/org/apache/hudi/index/bloom/BucketizedBloomCheckPartitioner.java
 ##########
 @@ -145,7 +145,7 @@ public int getPartition(Object key) {
     final Pair<String, String> parts = (Pair<String, String>) key;
     final long hashOfKey = NumericUtils.getMessageDigestHash("MD5", 
parts.getRight());
     final List<Integer> candidatePartitions = 
fileGroupToPartitions.get(parts.getLeft());
-    final int idx = (int) Math.floorMod(hashOfKey, candidatePartitions.size());
+    final int idx = (int) Math.floorMod((int) hashOfKey, 
candidatePartitions.size());
 
 Review comment:
   Hey @vinothchandar  If you take a look at the original discussion 
https://github.com/apache/incubator-hudi/issues/1455, there are different 
interface in java8 and other versions of java. The consolidate that difference, 
cast both to int or long will make less room for runtime error.

----------------------------------------------------------------
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

Reply via email to