Ben-Zvi commented on a change in pull request #1399: DRILL-6631: Streaming agg causes queries with Lateral and Unnest to r… URL: https://github.com/apache/drill/pull/1399#discussion_r205921657
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java ########## @@ -296,14 +295,15 @@ public IterOutcome innerNext() { if (firstBatchForDataSet && popConfig.getKeys().size() == 0 && recordCount == 0) { // if we have a straight aggregate and empty input batch, we need to handle it in a different way constructSpecialBatch(); - // set state to indicate the fact that we have sent a special batch and input is empty - specialBatchSent = true; // If outcome is NONE then we send the special batch in the first iteration and the NONE // outcome in the next iteration. If outcome is EMIT, we can send the special // batch and the EMIT outcome at the same time. - return getFinalOutcome(); + + IterOutcome finalOutcome = getFinalOutcome(); + return finalOutcome; } firstBatchForDataSet = true; + firstBatchForSchema = false; if(first) { Review comment: That **if()** is not needed. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services