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

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

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

    https://github.com/apache/drill/pull/407#discussion_r55595195
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
 ---
    @@ -162,6 +162,25 @@ private IterOutcome doWork() throws 
ClassTransformationException, IOException, S
         allocationVectors = Lists.newArrayList();
         transfers.clear();
     
    +    // If both sides of Union-All are empty
    +    if(unionAllInput.isBothSideEmpty()) {
    +      for(int i = 0; i < outputFields.size(); ++i) {
    --- End diff --
    
    For example, you could do:
    select a, b, c from empty union all select a, b, c from empty
    Then, the output should be (a, b, c) as column names.


> 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