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

    https://github.com/apache/drill/pull/407#discussion_r55605493
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
 ---
    @@ -491,6 +556,25 @@ private void inferOutputFieldsFromLeftSide() {
           }
         }
     
    +    private void inferOutputFieldsFromRightSide() {
    --- End diff --
    
    Inferencing happens only once when Drill receives the very first batches 
from left and right. (Schema-change is not yet supported for Union-All).
    
    Let me summarize the inference in four different situations:
    First of all, the field names are always determined by the left side (even 
when the left side is from empty file, we have the column names. Please see the 
comment above.)
    
    1. Left: non-empty; Right: non-empty=> types determined by both sides with 
implicit casting involved
    2. Left: empty; Right: non-empty=> type from the right
    3. Left: non-empty; Right: empty=> types from the left
    4. Left: empty; Right: empty=> types are nullable integer


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to