Fix ArrayAgg schema mismatch issue#8055
Merged
alamb merged 10 commits intoapache:mainfrom Nov 9, 2023
Merged
Conversation
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
jayzhan211
commented
Nov 5, 2023
alamb
approved these changes
Nov 8, 2023
Contributor
alamb
left a comment
There was a problem hiding this comment.
Thank you @jayzhan211 -- it would be nice if there was some way to avoid having to plumb the is_expr_nullable flag through, but I don't think there is
alamb
reviewed
Nov 8, 2023
Contributor
alamb
left a comment
There was a problem hiding this comment.
Thank you @jayzhan211 for the contribution and working on this area of the code
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #8032.
Rationale for this change
The main issue for #8032 is as what the errors said we have different schema for result.schema which is
logical-expr schemaand results.collect()[0].schema which isphysical-expr schema.We should have the same
is_nullablefor both logical-expr and physical-exprWe can see that the logical-expr of List is set with expr.nullable(schema)
https://github.com/apache/arrow-datafusion/blob/3469c4e09a3d32381949dd0c0f626f406c00c6ad/datafusion/expr/src/expr_schema.rs#L289-L305
and logical-expr of List element is set with the return type of Aggregatefunciton::ArrayAgg
https://github.com/apache/arrow-datafusion/blob/3469c4e09a3d32381949dd0c0f626f406c00c6ad/datafusion/expr/src/aggregate_function.rs#L286-L290
What changes are included in this PR?
Fix schema
is_nullableAre these changes tested?
I did not test end to end like #8032 , just make sure the schema is the same.
Are there any user-facing changes?