-
Notifications
You must be signed in to change notification settings - Fork 278
Open
Labels
Description
Description
GetArrayItem (i.e., arr[idx] where idx is a column reference rather than a literal) returns results in incorrect order.
How to reproduce
CREATE TABLE test_get_array_item(arr array<int>, idx int) USING parquet;
INSERT INTO test_get_array_item VALUES (array(10, 20, 30), 0), (array(10, 20, 30), 1), (array(10, 20, 30), 2), (array(1), 0), (NULL, 0), (array(10, 20), NULL);
SELECT arr[idx] FROM test_get_array_item;Expected results
[10]
[20]
[30]
[1]
[null]
[null]
Actual results
[10]
[10]
[1]
[20]
[30]
[null]
The results appear to be returned in an incorrect order.
Found via CometSqlFileTestSuite running expressions/array/get_array_item.sql.