[ 
https://issues.apache.org/jira/browse/DRILL-6657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16567029#comment-16567029
 ] 

ASF GitHub Bot commented on DRILL-6657:
---------------------------------------

sohami commented on a change in pull request #1413: DRILL-6657: Unnest reports 
one batch less than the actual number of b…
URL: https://github.com/apache/drill/pull/1413#discussion_r207287174
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unnest/UnnestRecordBatch.java
 ##########
 @@ -231,14 +223,18 @@ public IterOutcome innerNext() {
       }
       return IterOutcome.OK_NEW_SCHEMA;
     } else {
+      Preconditions.checkState(incoming.getRecordCount() > 0,
+        "Incoming batch post buildSchema phase should never be empty for 
Unnest");
       container.zeroVectors();
       // Check if schema has changed
       if (lateral.getRecordIndex() == 0) {
-        hasNewSchema = schemaChanged();
+        boolean hasNewSchema = schemaChanged();
         stats.batchReceived(0, incoming.getRecordCount(), hasNewSchema);
         if (hasNewSchema) {
           try {
             setupNewSchema();
+            hasRemainder = incoming.getRecordCount() > 0;
 
 Review comment:
   we can just set `hasRemainder=true` here since based on Preconditions check 
the right side will always be true.

----------------------------------------------------------------
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]


> Unnest reports one batch less than the actual number of batches
> ---------------------------------------------------------------
>
>                 Key: DRILL-6657
>                 URL: https://issues.apache.org/jira/browse/DRILL-6657
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Parth Chandra
>            Assignee: Parth Chandra
>            Priority: Major
>             Fix For: 1.15.0
>
>
> Unnest doesn't count the first batch that comes in. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to