Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/938#discussion_r137939184 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/HashAggTemplate.java --- @@ -109,14 +107,21 @@ private boolean isTwoPhase = false; // 1 phase or 2 phase aggr? private boolean is2ndPhase = false; - private boolean canSpill = true; // make it false in case can not spill + private boolean is1stPhase = false; + private boolean canSpill = true; // make it false in case can not spill/return-early private ChainedHashTable baseHashTable; private boolean earlyOutput = false; // when 1st phase returns a partition due to no memory private int earlyPartition = 0; // which partition to return early - - private long memoryLimit; // max memory to be used by this oerator - private long estMaxBatchSize = 0; // used for adjusting #partitions - private long estRowWidth = 0; + private boolean retrySameIndex = false; // in case put failed during 1st phase - need to output early, then retry --- End diff -- As it turns out, unlike C++, Java is pretty good at initializing booleans to false and longs to 0. We only need to explicitly initialize values when the value should be other than 0/false/null.
---