-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix struct casts to align fields by name (prevent positional mis-casts) #19674
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
Open
kosiew
wants to merge
71
commits into
apache:main
Choose a base branch
from
kosiew:struct-casting-17285
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,075
−115
Open
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
42fe863
Refactor struct casting and add unit tests
kosiew 6b7ce25
docs: Document struct field-by-name casting behavior in ColumnarValue…
kosiew edffe39
fix: Use Arc::clone instead of .clone() for ref-counted pointer
kosiew 77da244
fix: Support struct casting with field reordering and count changes
kosiew 9dc6f77
fix: Remove unused import of Fields in columnar_value.rs
kosiew 0544307
Fix final struct test case - use float format for coerced int field
kosiew 4075920
fix: Add name-based struct coercion for CASE expressions and struct t…
kosiew 9f04a4e
fix: Enable struct casting with field count changes by skipping const…
kosiew 67d2659
fix: Enable struct coercion TODO tests in case.slt
kosiew 129c9f7
refactor: Consolidate struct casting logic into nested_struct module
kosiew e337ef7
Add #17285 reproducer case
kosiew b0ed1ab
Add name-overlap detection and struct casting validation
kosiew cad6eac
Add null fast paths for struct casting and checks
kosiew 9b61e2f
refactor: Improve struct casting logic and enhance readability
kosiew b22a742
Fix plan errors from optimizer rule failures
kosiew 8682073
fix clippy
kosiew cc926b3
cargo fmt
kosiew 0fe71b3
docs(common): avoid intra-doc link to private function in nested_struct
kosiew d0f1cc0
docs(common): avoid broken intra-doc link to ParquetWriterOptions beh…
kosiew c39e9eb
remove reproducer case
kosiew 5ef5a12
Refactor cast_struct_column to eliminate duplication
kosiew 49ee3a6
docs: correct grammar in ColumnarValue casting documentation
kosiew de57ca9
docs: remove outdated example from cast_to documentation
kosiew 32065fa
refactor: simplify scalar casting in ColumnarValue
kosiew c76f1a6
refactor: remove redundant use of Field in tests
kosiew f0d43c4
refactor(expr-common): split struct coercion into name- and positiona…
kosiew 3bc5444
refactor(binary): remove redundant imports in struct coercion functions
kosiew 96b7f5f
refactor(expr-simplifier): remove comments about struct cast const-fo…
kosiew e4ae1bd
refactor(struct.slt): update comment for out of order struct literal …
kosiew 7eb379a
test(sqllogictest): remove redundant struct reordering tests covered …
kosiew 2f15474
refactor(struct.slt): remove redundant section header for struct cast…
kosiew 0897435
refactor(struct.slt): remove redundant tests covered by existing suites
kosiew f801f19
Merge branch 'main' into struct-casting-17285
kosiew aa04ded
struct casting: validate missing non-nullable target fields; add tests
kosiew 6558d69
fix(tests): streamline source struct initialization in casting tests
kosiew bdf5f20
fix clippy warning
kosiew 682d28a
Validate nullability of fields and improve error handling
kosiew 63e80f6
Fix struct casting validation: check nullability for NULL source type…
kosiew 0d5126c
Make cast_struct_array_by_name an internal function (pub(crate))
kosiew 81e56fb
Document necessity of null check in cast_struct_column for direct cal…
kosiew f304499
Document field name uniqueness assumptions in fields_have_same_names
kosiew 5f08346
Add debug assertions to validate field name uniqueness in fields_have…
kosiew c74bddd
Add comprehensive tests for struct cast const-folding behavior
kosiew 2734da2
Revert error handling in Optimizer
kosiew b9d79fc
Refactor imports in expr_simplifier.rs
kosiew 77a7f94
fix: improve error message for struct casting with mismatched field c…
kosiew 914356f
fix: clarify comment on null handling for struct column casting
kosiew af8e034
fix: remove unnecessary null handling checks in struct column casting
kosiew 20d1c38
fix: prevent const-folding of empty struct cast literals
kosiew e1eff12
fix clippy
kosiew ec26c5e
fix: simplify imports and improve test readability
kosiew f557de2
tests(expr_simplifier): extract helper to create empty StructArray
kosiew 11e8745
tests: extract make_struct_cast_expr helper for struct-cast tests
kosiew da60ed9
test: ensure struct cast with different field counts remains unchanged
kosiew 7652dbb
test: improve struct cast test assertions
kosiew ea748d3
test: update assertions for struct cast simplification to use assert_ne
kosiew f5642db
test: add case for struct cast with empty array not being foldable
kosiew 9f1d56e
refactor: remove cast_struct_array_by_name wrapper, consolidate on ca…
kosiew 5a4ecb1
cargo fmt
kosiew 2d5457b
refactor: rename fields_have_name_overlap to has_one_of_more_common_f…
kosiew 9f496dd
feat: add validate_struct_compatibility tests
kosiew 352066c
feat: add implicit coercion and field reordering tests for struct han…
kosiew e5d5d7a
feat: add array literal tests for struct field reordering and implici…
kosiew 8c0fe98
feat: add dynamic array construction tests for struct columns
kosiew 5e526b4
feat: add comprehensive implicit struct coercion tests
kosiew 20d0248
feat: add JOIN and WHERE clause coercion tests for structs
kosiew fba0610
feat: enhance struct coercion documentation and add user guide
kosiew 1d6a52c
Prettier fix
kosiew d3af52c
fix: improve error message for struct field casting compatibility
kosiew 8bdaa84
refactor: remove redundant NULL filling test for struct field casting
kosiew 3d3c99f
test: update struct field matching test to confirm unified type and v…
kosiew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR.
Fix to enable CI to pass.