Fix regression list Type Coercion List with inner type struct which has large/view types#14385
Merged
alamb merged 3 commits intoapache:mainfrom Feb 3, 2025
Merged
Conversation
This was referenced Jan 31, 2025
a578ebe to
f0583a6
Compare
comphead
approved these changes
Feb 3, 2025
comphead
reviewed
Feb 3, 2025
| query ? | ||
| select * from t; | ||
| ---- | ||
| {c0: a, c1: 1.0} |
Contributor
There was a problem hiding this comment.
the column names change is the part of the fix?
Contributor
Author
There was a problem hiding this comment.
Yes -- these are the field names of the struct type
The values that were written into the table are liek this (a few rows above). Note the field names are r and c
create table t as values({r: 'a', c: 1}), ({r: 'b', c: 2.3});Because they got coerced (1 needed to get coercered to the same type as 2.3) the field names got reassigned to c0 and c1 🤯 )
The fix in this PR preserves the names from the input which seems much more correct to me
alamb
added a commit
to alamb/datafusion
that referenced
this pull request
Feb 3, 2025
…as large/view types (apache#14385) * Test for coercing inner structs * Fix but, update tests * Update tests
This was referenced Feb 4, 2025
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?
Rationale for this change
See issue -- nested structs in Lists are not coerced correctly
What changes are included in this PR?
CASE#14384 to the type_union resolution)Are these changes tested?
Yes, new sqllogictests
Are there any user-facing changes?
Bug fix