You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/07/07 00:00:58 UTC

[GitHub] Ben-Zvi commented on a change in pull request #1358: DRILL-6516: EMIT support in streaming agg

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:
users@infra.apache.org


With regards,
Apache Git Services