You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Array Functions only return 1 element, and not working as expected #6709
As #6693#6694 reported,array_length only return 1 element, and array_position not working as expected.
I test other array functions, finding some bugs.
array_ndimsarray_prependarray_remove only return 1 element, array_prependarray_remove also not working as exected.
In array.slt file, I add more tests for array function
statement ok
create table foo3 as values (['abc', 'bac']), (['ac']);
query I
select array_length(column1) from foo3;
----
2
query error DataFusion error: Arrow error: Invalid argument error: column types must match schema types, expected UInt8 but found List\(Field \{ name: "item", data_type: UInt8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) at column index 0
select array_dims(column1) from foo3;
query error DataFusion error: Internal error: Array_fill is not implemented for type 'Utf8'\.\. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
select array_fill('a', column1) from foo3;
query I
select array_ndims(column1) from foo3;
----
1
query error DataFusion error: Arrow error: Invalid argument error: column types must match schema types, expected UInt8 but found Null at column index 0
select array_position(column1, 'a') from foo3;
query ?
select array_prepend('a', column1) from foo3;
----
[a, a, abc, bac, ac]
query ?
select array_remove(column1, 'a') from foo3;
----
[abc, bac, ac]
query error DataFusion error: SQL error: ParserError\("Expected end of statement, found: \("\)
select select array_replace(column1,'a', 'a') from foo3;
Activity
bubbajoe commentedon Jun 19, 2023
Thanks for testing! Should I close my tickets to avoid duplication?
parkma99 commentedon Jun 19, 2023
I think it's ok opening for track the
array_lengthandarray_positionbugs.izveigor commentedon Jun 29, 2023
@parkma99 the first implementation is only suitable for scalars. I will do for arrays soon.