diff options
author | Timothy Farkas <timothyfarkas@apache.org> | 2018-10-18 16:32:03 -0700 |
---|---|---|
committer | Timothy Farkas <timothytiborfarkas@gmail.com> | 2018-10-23 15:11:42 -0700 |
commit | 5859968d525dbb2f65b20a228a7f31dc9e516698 (patch) | |
tree | 058f85bba51938baab9d782bb752931cb6c74d31 /exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical | |
parent | 2882b89c2288a9df7c9abd5321cb85c588312b8c (diff) |
DRILL-6804: Simplify usage of OperatorPhase in HashAgg.
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/AggPrelBase.java | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/AggPrelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/AggPrelBase.java index 84f85ba2f..f3d527e82 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/AggPrelBase.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/AggPrelBase.java @@ -47,7 +47,42 @@ import java.util.List; public abstract class AggPrelBase extends DrillAggregateRelBase implements Prel { - public enum OperatorPhase {PHASE_1of1, PHASE_1of2, PHASE_2of2} + public enum OperatorPhase { + PHASE_1of1(false, false, false, "Single"), + PHASE_1of2(true, true, false, "1st"), + PHASE_2of2(true, false, true, "2nd"); + + private boolean hasTwo; + private boolean is1st; + private boolean is2nd; + private String name; + + OperatorPhase(boolean hasTwo, + boolean is1st, + boolean is2nd, + String name) { + this.hasTwo = hasTwo; + this.is1st = is1st; + this.is2nd = is2nd; + this.name = name; + } + + public boolean hasTwo() { + return hasTwo; + } + + public boolean is1st() { + return is1st; + } + + public boolean is2nd() { + return is2nd; + } + + public String getName() { + return name; + } + } protected OperatorPhase operPhase = OperatorPhase.PHASE_1of1; // default phase protected List<NamedExpression> keys = Lists.newArrayList(); |