Ben-Zvi commented on a change in pull request #1358: DRILL-6516: EMIT support
in streaming agg
URL: https://github.com/apache/drill/pull/1358#discussion_r199960750
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java
##########
@@ -496,6 +620,30 @@ private void getIndex(ClassGenerator<StreamingAggregator>
g) {
}
}
+ private IterOutcome getFinalOutcome() {
+ IterOutcome outcomeToReturn;
+
+ if(firstBatchForDataSet) {
+ firstBatchForDataSet = false;
+ }
+ if (firstBatchForSchema) {
+ outcomeToReturn = OK_NEW_SCHEMA;
+ firstBatchForSchema = false;
+ } else if (recordCount == 0) {
+ // get the outcome to return before calling refresh since that resets
the lastKnowOutcome to OK
+ outcomeToReturn = lastKnownOutcome == EMIT ? EMIT : NONE;
+ if (outcomeToReturn == EMIT) {
+ firstBatchForDataSet = true;
+ }
+ } else if (lastKnownOutcome == EMIT) {
Review comment:
(A minor comment) This "else if" can be moved up (to become the first "else
if"), then all is needed is one "else" with `outcomeToReturn = recordCount == 0
? NONE : OK;`
----------------------------------------------------------------
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