Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: array_length only return 1 element #6693

Closed
bubbajoe opened this issue Jun 16, 2023 · 3 comments · Fixed by #6864
Closed

bug: array_length only return 1 element #6693

bubbajoe opened this issue Jun 16, 2023 · 3 comments · Fixed by #6864
Labels
bug Something isn't working

Comments

@bubbajoe
Copy link

bubbajoe commented Jun 16, 2023

Describe the bug

select array_field from table

array_field
[abc, acb]
[bca, bac]
[cab, cba]

select array_length(array_field) from table

array_length(array_field)
2

To Reproduce

select array_length(array_field) from table

Expected behavior

select array_length(array_field) from table

array_length(array_field)
2
2
2

Additional context

array_field: Utf8

@Weijun-H
Copy link
Member

I believe this problem arises from our approach of treating all instances of List as the same situation.
https://github.com/apache/arrow-datafusion/blob/94c442c8ff24a2b23f29d7579a0560c6daf76be9/datafusion/physical-expr/src/array_expressions.rs#L951-L958

@izveigor
Copy link
Contributor

@bubbajoe the first implementation is only suitable for scalars. I will do for arrays soon.

@izveigor
Copy link
Contributor

@bubbajoe Closed by #6864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants