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

    https://github.com/apache/drill/pull/1226#discussion_r183768380
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java 
---
    @@ -634,10 +634,14 @@ public void testFilterPushDownOverUnionAll() throws 
Exception {
             + "order by n_regionkey";
     
         // Validate the plan
    -    final String[] expectedPlan = {".*Filter.*\n" +
    -            ".*UnionAll.*\n" +
    -            ".*Scan.*columns=\\[`n_regionkey`\\].*\n" +
    -            ".*Scan.*columns=\\[`r_regionkey`\\].*"};
    +    final String[] expectedPlan = {"Sort.*\n" +
    --- End diff --
    
    Looks like there are no issues related to it. I have added additional test 
case to verify it:
    `select n_nationkey from (select n_nationkey, n_name, n_comment from 
cp."tpch/nation.parquet" union all select r_regionkey, r_name, r_comment  from 
cp."tpch/region.parquet") where n_nationkey > 4;`
    When filter is pushed down the result from right side of UNION will be 
empty.
    
    Generally speaking using UNION operator with empty data was resolved in 
[DRILL-4185](https://issues.apache.org/jira/browse/DRILL-4185) and we have test 
cases with empty data batches.


---

Reply via email to