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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.14.0
    • None
    • None
    • 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

        1. Test_data.tar.gz
          1 kB
          Anton Gozhiy

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: