Ben-Zvi commented on a change in pull request #1508: DRILL-6804: Simplify usage 
of OperatorPhase in HashAgg.
URL: https://github.com/apache/drill/pull/1508#discussion_r227199443
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/AggPrelBase.java
 ##########
 @@ -47,7 +47,39 @@
 
 public abstract class AggPrelBase extends DrillAggregateRelBase implements 
Prel {
 
-  public enum OperatorPhase {PHASE_1of1, PHASE_1of2, PHASE_2of2}
+  public enum OperatorPhase {
+    PHASE_1of1(false, true, "Single"),
+    PHASE_1of2(true, true, "1st"),
+    PHASE_2of2(true, false, "2nd");
+
+    private boolean hasTwo;
+    private boolean is1st;
+    private String name;
+
+    OperatorPhase(boolean hasTwo,
+                  boolean is1st,
+                  String name) {
+      this.hasTwo = hasTwo;
+      this.is1st = is1st;
+      this.name = name;
+    }
+
+    public boolean hasTwo() {
+      return hasTwo;
+    }
+
+    public boolean is1st() {
+      return is1st;
 
 Review comment:
   Note that if some future code would call `is1st()` on a single phase, the 
result would be TRUE !!
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to