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

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

Github user amansinha100 commented on a diff in the pull request:

    https://github.com/apache/drill/pull/407#discussion_r55779800
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
 ---
    @@ -294,13 +313,41 @@ public UnionAllInput(UnionAllRecordBatch 
unionAllRecordBatch, RecordBatch left,
           rightSide = new OneSideInput(right);
         }
     
    +    private boolean isBothSideEmpty() {
    +      return leftIsFinish && rightIsFinish;
    +    }
    +
         public IterOutcome nextBatch() throws SchemaChangeException {
           if(upstream == RecordBatch.IterOutcome.NOT_YET) {
             IterOutcome iterLeft = leftSide.nextBatch();
             switch(iterLeft) {
               case OK_NEW_SCHEMA:
    -            break;
    +            whileLoop:
    +            while(leftSide.getRecordBatch().getRecordCount() == 0) {
    +              iterLeft = leftSide.nextBatch();
    +
    +              switch(iterLeft) {
    +                case STOP:
    +                case OUT_OF_MEMORY:
    +                  return iterLeft;
    +
    +                case NONE:
    --- End diff --
    
    Could you add comments here about why we need to keep reading after getting 
OK_NEW_SCHEMA.  Also, do any of the union-all tests (either unit or functional) 
exercise this code ? i.e where the left input has 2 or more empty files ?


> Enhance Union-All operator for dealing with empty left input or empty both 
> inputs
> ---------------------------------------------------------------------------------
>
>                 Key: DRILL-4476
>                 URL: https://issues.apache.org/jira/browse/DRILL-4476
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Relational Operators
>            Reporter: Sean Hsuan-Yi Chu
>            Assignee: Sean Hsuan-Yi Chu
>
> Union-All operator does not deal with the situation where left side comes 
> from empty source.
> Due to DRILL-2288's enhancement for empty sources, Union-All operator now can 
> be allowed to support this scenario.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to