zhilinli123 commented on PR #4772:
URL: https://github.com/apache/seatunnel/pull/4772#issuecomment-1578863668

   > > It's not a negative number, right? @Hisoka-X
   > 
   > @zhilinli123 It can't be negative. I suggest compare two result of change 
before and change after.
   
   ```
       public static void main(String[] args) {
           // Create an instance of the XXHash64 algorithm
           XXHashFactory factory = XXHashFactory.fastestInstance();
           XXHash64 hash64 = factory.hash64();
   
           // Define your input data
           byte[] input ;
           String a = "a,b,c,d,e,f";
           for (String inputs : a.split(",")) {
               input = inputs.getBytes();
               // Calculate the hash value
               long hashValue = hash64.hash(input, 0, input.length, 0);
   
               // Apply modulo operation to get a non-negative result
               int modulo = 6;
               long nonNegativeResult = (hashValue & Long.MAX_VALUE) % modulo;
   
               // Print the non-negative result
               System.out.println("Non-negative result: " + nonNegativeResult);
   
           }
       }
   ```
   I have written a simple test demo about this problem, please help to see if 
it meets the expectations
   @Hisoka-X 


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

Reply via email to