deniskuzZ commented on code in PR #5409:
URL: https://github.com/apache/hive/pull/5409#discussion_r1812628674


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/CustomPartitionVertex.java:
##########
@@ -75,23 +75,13 @@
  */
 public class CustomPartitionVertex extends VertexManagerPlugin {
 
-  public class PathComparatorForSplit implements Comparator<InputSplit> {
+  public static class ComparatorForSplit implements Comparator<InputSplit> {
 
     @Override
     public int compare(InputSplit inp1, InputSplit inp2) {
-      FileSplit fs1 = (FileSplit) inp1;
-      FileSplit fs2 = (FileSplit) inp2;
-
-      int retval = fs1.getPath().compareTo(fs2.getPath());
-      if (retval != 0) {
-        return retval;
-      }
-
-      if (fs1.getStart() != fs2.getStart()) {
-        return (int) (fs1.getStart() - fs2.getStart());
-      }
-
-      return 0;
+      HiveInputSplit fs1 = (HiveInputSplit) inp1;
+      HiveInputSplit fs2 = (HiveInputSplit) inp2;
+      return 
UnsignedBytes.lexicographicalComparator().compare(fs1.getBytesForIdentity(), 
fs2.getBytesForIdentity());

Review Comment:
   previously we compared `FileSplit.start` as well, so I am not sure if it's a 
safe change



-- 
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: gitbox-unsubscr...@hive.apache.org

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


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

Reply via email to