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

Queries with Window Function DENSE_RANK fail with SchemaChangeException

    XMLWordPrintableJSON

Details

    Description

      Example queries which result in exceptions:

      DENSE_RANK WF with ORDER BY 1 column and GROUP BY, ORDER BY on the main query

      SELECT DENSE_RANK() OVER (ORDER BY ss.ss_store_sk) FROM store_sales ss GROUP BY ss.ss_store_sk, ss.ss_net_paid_inc_tax ORDER BY 1 LIMIT 20;
      Error: SYSTEM ERROR: org.apache.drill.exec.exception.SchemaChangeException: Failure while materializing expression. 
      Error in expression at index 0.  Error: Missing function implementation: [dense_rank(INT-REQUIRED)].  Full expression: null.
      Fragment 4:10
      [Error Id: 4b9187db-e770-4e7f-afe4-0d4dfc045088 on abhi6.qa.lab:31010] (state=,code=0)
      

      DENSE_RANK WF with PARTITION BY 2 columns and ORDER BY 2 column and GROUP BY, ORDER BY on the main query

      SELECT DENSE_RANK() OVER (PARTITION BY s.ss_store_sk, s.ss_customer_sk ORDER BY s.ss_store_sk, s.ss_customer_sk) FROM store_sales s GROUP BY s.ss_store_sk, s.ss_customer_sk, s.ss_quantity ORDER BY 1  LIMIT 20;
      Error: SYSTEM ERROR: org.apache.drill.exec.exception.SchemaChangeException: Failure while materializing expression. 
      Error in expression at index 0.  Error: Missing function implementation: [dense_rank(INT-REQUIRED)].  Full expression: null.
      Fragment 5:22
      [Error Id: 3ac6e4ce-5bb3-4058-b806-3d0becbbd0d1 on abhi6.qa.lab:31010] (state=,code=0)
      

      The queries execute fine on Postgres

      Attachments

        1. drillbit.log.txt
          10 kB
          Abhishek Girish
        2. 0001-DRILL-3337-Fix-is-in-Calcite-see-CALCITE-770.-Add-un.patch
          2 kB
          Aman Sinha

        Activity

          People

            amansinha100 Aman Sinha
            agirish Abhishek Girish
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: