You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Anton Gozhiy (JIRA)" <ji...@apache.org> on 2018/05/15 11:47:00 UTC

[jira] [Created] (DRILL-6417) Project is not pushed into scan if use subquery with UNION operator

Anton Gozhiy created DRILL-6417:
-----------------------------------

             Summary: Project is not pushed into scan if use subquery with UNION operator
                 Key: DRILL-6417
                 URL: https://issues.apache.org/jira/browse/DRILL-6417
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.14.0
            Reporter: Anton Gozhiy


*Data:*
Use attached dataset

*Query:*
{code:sql}
explain plan for select id
from 
  (select id, part_col, int_col, bool_col, date_col, float_col, time_col, ts_col
   from dfs.tmp.`DRILL_3855_test_data`
   where part_col = 'Partition_one' or part_col = 'Partition_two'
   union
   select id, part_col, int_col, bool_col, date_col, float_col, time_col, ts_col
   from dfs.tmp.`DRILL_3855_test_data`
   where part_col = 'Partition_two' or part_col = 'Partition_three')
where int_col = 0
{code}

*Expected plan:*
{noformat}
Scan ... columns=[`part_col`, `id`, `int_col`]
{noformat}

*Actual plan:*
{noformat}
Scan ... columns=[`part_col`, `id`, `int_col`, `bool_col`, `date_col`, `float_col`, `time_col`, `ts_col`]
{noformat}

*Notes:*
Works as expected if change "union" to "union all"



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