Guosmilesmile commented on PR #12703:
URL: https://github.com/apache/iceberg/pull/12703#issuecomment-2775797791

   @pvary  The array made by this method is used in SketchUtil.partition to 
find  a SortKey in which part. So, I think a shorter array in this case is ok .
   
   
https://github.com/apache/iceberg/blob/95493dff114a6898bf9dcd02699a3fe4bbca4640/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/shuffle/SketchUtil.java#L147
   
   ```java
   static int partition(
         SortKey key, int numPartitions, SortKey[] rangeBounds, 
Comparator<StructLike> comparator) {
       int partition = Arrays.binarySearch(rangeBounds, key, comparator);
   
       // binarySearch either returns the match location or -[insertion point]-1
       if (partition < 0) {
         partition = -partition - 1;
       }
   
       if (partition > rangeBounds.length) {
         partition = rangeBounds.length;
       }
   
       return RangePartitioner.adjustPartitionWithRescale(
           partition, rangeBounds.length + 1, numPartitions);
     }
   ```


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to