Repository navigation
perf: compare nested ScalarValues by type before converting to ArrayData - #26066
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adriangb
enabled auto-merge
October 13, 2026 21:38
adriangb
reviewed
Oct 13, 2026
Comment on lines
+484
to
+485
| // manual implementation of `PartialEq` | ||
| /// Equality of the arrays inside nested scalars. |
Contributor
There was a problem hiding this comment.
I think we should move // manual implementation of PartialEq` to where it was originally
adriangb
reviewed
Oct 13, 2026
Contributor
|
Thank you @alexy |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26066 +/- ##
==========================================
+ Coverage 82.69% 82.83% +0.14%
==========================================
Files 1147 1149 +2
Lines 447204 452843 +5639
Branches 447204 452843 +5639
==========================================
+ Hits 369793 375134 +5341
+ Misses 55001 54882 -119
- Partials 22410 22827 +417 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Physical planning slows down, faster than the query grows, when projections carry many typed NULL struct literals: a
UNION ALLof 35 branches with 35 struct columns of 20 fields takes 862 ms increate_physical_planonmain.EquivalenceGroup::add_constantcompares each new constant with every existing class, andScalarValue::eqcompares nested values with arrow's array equality, which converts both arrays toArrayDatabefore it compares anything, even when the two values have different types.What changes are included in this PR?
ScalarValue::eqcompares the nested variants (List,LargeList,FixedSizeList,ListView,LargeListView,Struct,Map) through a helper that returns early for the sameArc, and compares lengths and data types before arrow's array equality. Results are unchanged; only values of the same type and length reach theArrayDatacomparison.With the reproducer from the issue (release build, Apple M1 Max),
create_physical_plan:What is the testing strategy for this PR?
test_nested_scalar_eqcovers typed NULL structs of the same and of different types, struct values that are equal and unequal, and lists of different element types. The scalar tests indatafusion-commonpass.Are there any user-facing changes?
No.
🤖 Generated with Claude Code