Skip per-row convertTypes() in FunctionOperand when types already match#17730
Draft
yashmayya wants to merge 2 commits intoapache:masterfrom
Draft
Skip per-row convertTypes() in FunctionOperand when types already match#17730yashmayya wants to merge 2 commits intoapache:masterfrom
yashmayya wants to merge 2 commits intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17730 +/- ##
=========================================
Coverage 63.18% 63.19%
- Complexity 1499 1502 +3
=========================================
Files 3181 3181
Lines 190816 190832 +16
Branches 29164 29171 +7
=========================================
+ Hits 120566 120595 +29
+ Misses 60864 60847 -17
- Partials 9386 9390 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 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.
Summary
Motivation
Benchmark Results
Isolated, skipping convertTypes() on matching types yields ~4x throughput (0.166 vs 0.041 ops/μs). End-to-end in apply(), the improvement is ~15% as the cost is diluted by toExternal(), reflection-based Method.invoke(), and toInternal().
Edit: This optimization is skipped for array types. In the multi-stage query engine, when data flows between stages via
DataBlockserialization, array types can be deserialized into a different Java class than expected (e.g.,Double[]instead ofdouble[]forDOUBLE_ARRAY). Our ColumnDataType-level comparison can't detect this because both map to DOUBLE_ARRAY and this is an issue because arrays don't have autoboxing in Java.