Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.8.0
-
None
Description
Adding a WITH clause with a simple CTE causes a query with an ORDER BY to fail. This happens even when the CTE is unrelated to the main query.
The following query fails to execute:
WITH x AS (SELECT ss_sold_date_sk a1 FROM store_sales) SELECT x.a1 FROM x ORDER BY x.a1;
Error:
Query failed: SqlValidatorException: Table 'x' not found
Log attached.
The following query executes fine:
WITH x AS (SELECT ss_sold_date_sk a1 FROM store_sales) SELECT x.a1 FROM x
Attachments
Attachments
Issue Links
- duplicates
-
DRILL-2301 Query fails when multiple table aliases are provided for CTEs
- Closed