richardstartin commented on a change in pull request #8221:
URL: https://github.com/apache/pinot/pull/8221#discussion_r810336904



##########
File path: 
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/partition/ByteArrayPartitionFunction.java
##########
@@ -40,8 +42,8 @@ public ByteArrayPartitionFunction(int numPartitions) {
   }
 
   @Override
-  public int getPartition(Object valueIn) {
-    return abs(Arrays.hashCode(valueIn.toString().getBytes())) % 
_numPartitions;
+  public int getPartition(Object value) {
+    return (Math.abs(Arrays.hashCode(value.toString().getBytes(UTF_8))) & 
Integer.MAX_VALUE) % _numPartitions;

Review comment:
       Ok I didn’t realise there was a predefined output requirement, just that 
min value needed to end up non negative somehow. Makes sense.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to