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

Invalid query must be caught earlier

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.1.0
    • Labels:
      None
    • Environment:

      8815eb7d

      Description

      The below query is not valid and we must report an error instead of returning results. Postgres doe not support this kind of a query.

      Drill returns some results, we must instead report an error to user.

      0: jdbc:drill:schema=dfs.tmp> SELECT MIN(col_int) OVER() FROM vwOnParq group by col_char_2;
      +---------+
      | EXPR$0  |
      +---------+
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      | AZ      |
      +---------+
      18 rows selected (0.27 seconds)
      

      Output from Postgres

      postgres=# select min(col_int) over() from all_typs_tbl group by col_char_2;
      ERROR:  column "all_typs_tbl.col_int" must appear in the GROUP BY clause or be used in an aggregate function
      LINE 1: select min(col_int) over() from all_typs_tbl group by col_ch...
      

      Querying the original parquet file that was used to create the view, returns an assertion error

      0: jdbc:drill:schema=dfs.tmp> SELECT MIN(col_int) OVER() FROM `tblForView/0_0_0.parquet` group by col_char_2;
      Error: SYSTEM ERROR: java.lang.AssertionError: Internal error: while converting MIN(`tblForView/0_0_0.parquet`.`col_int`)
      
      
      [Error Id: e8ed279d-aa8c-4db1-9906-5dd7fdecaac2 on centos-02.qa.lab:31010] (state=,code=0)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jni Jinfeng Ni
                Reporter:
                khfaraaz Khurram Faraaz
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: