-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
make_array
null handling with nested version
#7136
Comments
My suggestion is to follow the DuckDB / Clickhouse behavior We are having a similar discussion about semantics of Unnest here #7088 (comment) Maybe @vincev has some opinions as well |
This makes sense to me too, another thing I have noticed (maybe related to this) is that arrays with a null value generate error:
DuckDB generates:
|
Oh I see there is a workaround for that:
|
Agree with @alamb and @vincev. Thank you for bringing this topic up, @jayzhan211. |
I will fix the third case first. |
Is your feature request related to a problem or challenge?
Follow up on #6900. Implement array() nested version.
It seems calling array() for list return flattened list according to the comment
https://github.com/apache/arrow-datafusion/blob/2cf5f5b5bb824598de185d64c541c52c930728cf/datafusion/physical-expr/src/array_expressions.rs#L243-L254
However, I think make_array should wrap the elements into array, the expected behavior
make_array([A,X], []) -> [[A,X], []]
,make_array([null, Y], [Q,R,S]) -> [[null,Y],[Q,R,S]]
andmake_array([C,Z], null) -> [[C,Z], null]
Main branch:
As a result, only the third case fails, the first case is acceptable but should we expected
[[A, X], []]
to differentiate withnull
can also be discussedDescribe the solution you'd like
Fix the third case and update the comments.
Optional: Expect the first case to return
[[A, X], []]
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: