Khurram Faraaz created DRILL-3351:
-------------------------------------
Summary: Invalid query must be caught earlier
Key: DRILL-3351
URL: https://issues.apache.org/jira/browse/DRILL-3351
Project: Apache Drill
Issue Type: Bug
Components: Query Planning & Optimization
Affects Versions: 1.1.0
Environment: 8815eb7d
Reporter: Khurram Faraaz
Assignee: Jinfeng Ni
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.
{code}
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)
{code}
Output from Postgres
{code}
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...
{code}
Querying the original parquet file that was used to create the view, returns an
assertion error
{code}
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)
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)