Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.0.0
Description
Query below throws an error:
create table test(x1, x2) partition by (x1) as select sum(a1), b1 from t1 group by b1;
0: jdbc:drill:schema=dfs> create table test(x1, x2) partition by (x1) as select sum(a1), b1 from t1 group by b1; Error: SYSTEM ERROR: IllegalArgumentException: partition col x1 could not be resolved in table's column lists! [Error Id: ab5624e8-e4dd-4752-95af-8bc2eef5d056 on atsqa4-133.qa.lab:31010] (state=,code=0)
When column aliases are used, it works:
0: jdbc:drill:schema=dfs> create table test partition by (x1) as select sum(a1) x1, b1 x2 from t1 group by b1; +-----------+----------------------------+ | Fragment | Number of records written | +-----------+----------------------------+ | 0_0 | 10 | +-----------+----------------------------+ 1 row selected (0.904 seconds) 0: jdbc:drill:schema=dfs> select * from test; +-------+--------+ | x1 | x2 | +-------+--------+ | null | hhhhh | | 2 | bbbbb | | 10 | jjjjj | | 1 | aaaaa | | 3 | ccccc | | 4 | null | | 5 | eeeee | | 7 | ggggg | | 6 | fffff | | 9 | iiiii | +-------+--------+ 10 rows selected (0.161 seconds) 0: jdbc:drill:schema=dfs> select * from test order by x1; +-------+--------+ | x1 | x2 | +-------+--------+ | 1 | aaaaa | | 2 | bbbbb | | 3 | ccccc | | 4 | null | | 5 | eeeee | | 6 | fffff | | 7 | ggggg | | 9 | iiiii | | 10 | jjjjj | | null | hhhhh | +-------+--------+ 10 rows selected (0.299 seconds)