-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
non-null sub-field on nullable struct-field has wrong nullity. #8507
Comments
Thank you for the report @jacksonrnewhouse -- this looks like a good first issue as it has a reproducer and a hit about where in the code to fix it, to me so marking it as such |
@alamb I will try to solve the issue |
Hi @alamb, what I understand after reading the issue is that I should check condition whether the parent is null || sub-fields are null. if I am wrong please correct me. |
That sounds about right @ravikiran232 -- what I would suggest doing first is creating a reproducer / test that shows the behavior described in this ticket. Then the fix should likely be straightforward |
Hi @ravikiran232 are you still working on this? Hi @alamb just to confirm the approach. If @ravikiran232 is not currently working on this anymore, I'd be more than happy to contribute. Thank you for you feedback and your efforts. |
Hi @marvinlanhenke, continue with the issue |
…ity (#8623) * added test * added guard clause * rename schema fields * clippy --------- Co-authored-by: mlanhenke <[email protected]>
Describe the bug
If you have table schema like
And run a query like
SELECT bid.auction FROM nexmark
you'll get an error when bid is null. Error looks likeThe problem is that the nullable() method only looks at the sub-fields nullability, ignoring that the parent field may be null.
https://github.com/apache/arrow-datafusion/blob/main/datafusion/expr/src/expr_schema.rs#L280.
To Reproduce
No response
Expected behavior
The expression should be nullable, as its parent may not be present.
Additional context
No response
The text was updated successfully, but these errors were encountered: