Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
git.commit.id.abbrev=f066786
The below query results in an error :
create table dfs.ctas_flatten.`test` as select uid, flatten(lst_lst) lst, flatten(lst_lst[0]) from `data1.json` order by flatten(lst_lst[0]); Query failed: IndexOutOfBoundsException: index (2) must be less than size (2) Error: exception while executing query: Failure while executing query. (state=,code=0)
The logs indicate an assertion error :
Caused by: java.lang.AssertionError: Internal error: Error while applying rule ExpandConversionRule, args [rel#1757858:AbstractConverter.PHYSICAL.SINGLETON([]).[2](child=rel#1757856:Subset#8.PHYSICAL.ANY([]).[2],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[2])]
The query itself does not have any issues. Also the below variants work :
1. No flatten of repeated list in the select clause create table dfs.ctas_flatten.`test` as select uid, flatten(lst_lst[0]) from `data1.json` order by flatten(lst_lst[0]); 2. Removing the flatten from the order by. (Ordering by a scalar has no issues) create table dfs.ctas_flatten.`test` as select uid, flatten(lst_lst) lst, flatten(lst_lst[0]) from `data1.json`;
Attached the data set and the complete error log file