kasakrisz commented on a change in pull request #2381:
URL: https://github.com/apache/hive/pull/2381#discussion_r649926112
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/BucketVersionPopulator.java
##########
@@ -131,22 +132,47 @@ private OpGroup newGroup(NodeProcessorCtx procCtx) {
}
}
+ enum InfoType {
+ MANDATORY, OPTIONAL,
+ };
+
/**
* This class represents the version required by an Operator.
*/
- private static class OperatorBucketingVersionInfo {
+ static class OperatorBucketingVersionInfo {
+
+ public static final Comparator<OperatorBucketingVersionInfo>
MANDATORY_FIRST =
+ new Comparator<BucketVersionPopulator.OperatorBucketingVersionInfo>() {
+ @Override
+ public int compare(OperatorBucketingVersionInfo i1,
OperatorBucketingVersionInfo i2) {
+ int r = i1.infoType.compareTo(i2.infoType);
+ if (r != 0) {
+ // mandatory first
+ return r;
+ }
+ r = i2.bucketingVersion - i1.bucketingVersion;
Review comment:
nit. `Integer.compare(i2.bucketingVersion, i1.bucketingVersion)` can be
used here.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]