Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6417

Project is not pushed into scan if use subquery with UNION operator

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.14.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Data:
      Use attached dataset

      Query:

      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
      

      Expected plan:

      Scan ... columns=[`part_col`, `id`, `int_col`]
      

      Actual plan:

      Scan ... columns=[`part_col`, `id`, `int_col`, `bool_col`, `date_col`, `float_col`, `time_col`, `ts_col`]
      

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vitalii Vitalii Diravka
                Reporter:
                angozhiy Anton Gozhiy
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: