Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
1.1.0
Description
Drill fails to validate invalid positions within the ORDER BY clause of a window function:
> select s_city, s_store_sk, sum(s_number_employees) over (PARTITION BY s_city ORDER BY 40) from store limit 10; +-----------+-------------+---------+ | s_city | s_store_sk | EXPR$2 | +-----------+-------------+---------+ | Fairview | 5 | 860 | | Fairview | 8 | 860 | | Fairview | 12 | 860 | | Midway | 1 | 2320 | | Midway | 2 | 2320 | | Midway | 3 | 2320 | | Midway | 4 | 2320 | | Midway | 6 | 2320 | | Midway | 7 | 2320 | | Midway | 9 | 2320 | +-----------+-------------+---------+ 10 rows selected (0.224 seconds)
Drill validates the same, when the ORDER BY clause is a part of the main query
> select s_city, s_store_sk, sum(s_number_employees) from store group by s_city, s_store_sk ORDER BY 40 limit 10; Error: PARSE ERROR: From line 1, column 101 to line 1, column 102: Ordinal out of range [Error Id: 0458fba1-afd6-48cf-89ba-1e4c107d2426 on abhi8.qa.lab:31010] (state=,code=0)