lamber-ken edited a comment on issue #1455: [SUPPORT] Hudi upsert run into 
exception:  java.lang.NoSuchMethodError: java.lang.Math.floorMod(JI)I
URL: https://github.com/apache/incubator-hudi/issues/1455#issuecomment-605100639
 
 
   Welcome @EdwinGuo, to figure it out, we need to add some log statement.
   ```
   git clone [email protected]:apache/incubator-hudi.git
   mvn clean install -DskipTests -DskipITs -Dcheckstyle.skip=true 
-Drat.skip=true -T 2C
   ```
   
   ```
   @Override
   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());
   
     int idx = 0;
     try {
        idx = (int) Math.floorMod(hashOfKey, candidatePartitions.size());
     } catch (Exception e) {
       LOG.error("hashOfKey: " + hashOfKey + ",  " + 
candidatePartitions.size());
       throw new RuntimeException(e);
     }
     
     assert idx >= 0;
     return candidatePartitions.get(idx);
   }
   ```

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