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

UNION ALL on Aggregates with GROUP BY and ORDER BY fails when column aliases don't match

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Pending Closed
    • 0.9.0
    • 1.0.0
    • None

    Description

      The following query fails to execute:

      select x
      from
      (SELECT Sum(ss_ext_sales_price) x
      FROM  store_sales
      UNION ALL
      SELECT Sum(cs_ext_sales_price) y
      FROM catalog_sales) tmp
      GROUP BY x
      ORDER BY x;
      
      Error from Drill:
      Query failed: RemoteRpcException: Failure while running fragment., Failure while reading vector.  Expected vector class of org.apache.drill.exec.vector.Decimal38SparseVector but was holding vector class org.apache.drill.exec.vector.NullableIntVector. [ 7cc962d6-569b-44f6-9118-d5cc5a9632d9 on abhi7.qa.lab:31010 ]
      [ 7cc962d6-569b-44f6-9118-d5cc5a9632d9 on abhi7.qa.lab:31010 ]
      java.lang.RuntimeException: java.sql.SQLException: Failure while executing query.
      	at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
              ...
      

      Log snippet attached.

      The following query executes fine (although returns incomplete results - see DRILL-2376:

      select x
      from
      (SELECT Sum(ss_ext_sales_price) x
      FROM  store_sales
      UNION ALL
      SELECT Sum(cs_ext_sales_price) x
      FROM catalog_sales) tmp
      GROUP BY x
      ORDER BY x;
      

      Attachments

        1. drillbit.log
          16 kB
          Abhishek Girish

        Issue Links

          Activity

            People

              seanhychu Sean Hsuan-Yi Chu
              agirish Abhishek Girish
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: