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

Need a better error message - Use of alias in window function definition

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.2.0
    • Component/s: Execution - Flow
    • Labels:
      None

      Description

      Need a better error message when we use alias for window definition in query that uses window functions. for example, OVER(PARTITION BY columns[0] ORDER BY columns[1]) tmp, and if alias "tmp" is used in the predicate we need a message that says, column "tmp" does not exist, that is how it is in Postgres 9.3

      Postgres 9.3

      postgres=# select count(*) OVER(partition by type order by id) `tmp` from airports where tmp is not null;
      ERROR:  column "tmp" does not exist
      LINE 1: ...ect count(*) OVER(partition by type order by id) `tmp` from ...
                                                                   ^
      

      Drill 1.0

      0: jdbc:drill:schema=dfs.tmp> select count(*) OVER(partition by columns[2] order by columns[0]) tmp from `airports.csv` where tmp is not null;
      Error: SYSTEM ERROR: java.lang.IllegalArgumentException: Selected column(s) must have name 'columns' or must be plain '*'
      
      Fragment 0:0
      
      [Error Id: 66987b81-fe50-422d-95e4-9ce61c873584 on centos-02.qa.lab:31010] (state=,code=0)
      

        Attachments

        1. DRILL-3243.1.patch.txt
          7 kB
          Deneche A. Hakim
        2. DRILL-3243.2.patch.txt
          7 kB
          Deneche A. Hakim

          Activity

            People

            • Assignee:
              adeneche Deneche A. Hakim
              Reporter:
              khfaraaz Khurram Faraaz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: