Ben-Zvi commented on a change in pull request #1490: DRILL-6766: Lateral Unnest query : IllegalStateException - rowId in right batch of lateral is smaller than rowId in left batch being processed URL: https://github.com/apache/drill/pull/1490#discussion_r222874084
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java ########## @@ -259,15 +265,16 @@ public IterOutcome innerNext() { throw new IllegalStateException(String.format("unknown outcome %s", lastKnownOutcome)); } } else { - if ( lastKnownOutcome != NONE && firstBatchForDataSet && !aggregator.isDone()) { + if ( lastKnownOutcome != NONE && firstBatchForDataSet && !aggregator.isDone() + && aggregator.previousBatchProcessed()) { Review comment: How about putting this "review comment" as a comment in the code (with some rewording).. ---------------------------------------------------------------- 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