feat: Expose fixed-array inner product in SQL - #29033
Merged
Merged
Conversation
0guban0v
requested review from
MarcoGorelli,
alexander-beedie,
c-peters,
orlp and
ritchie46
as code owners
August 29, 2026 21:48
0guban0v
marked this pull request as draft
August 29, 2026 21:54
0guban0v
marked this pull request as ready for review
August 29, 2026 22:42
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29033 +/- ##
==========================================
+ Coverage 81.40% 81.47% +0.06%
==========================================
Files 1888 1888
Lines 267825 267855 +30
Branches 3061 3061
==========================================
+ Hits 218012 218222 +210
+ Misses 49033 48854 -179
+ Partials 780 779 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ritchie46
approved these changes
Aug 31, 2026
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.
Closes #28928
Adds
ARRAY_INNER_PRODUCT(lhs, rhs)andARRAY_DOT_PRODUCTas SQL entry points to native fixed-size Array dot path introduced in #28504 and extended across integer dtypes in #28829.Lowering deliberately ends at
Expr::arr().dot()instead of rebuilding(lhs * rhs).arr.sum(). SQL inherits supertype coercion, output dtype, integer wrapping, null behavior, execution-engine behavior, and allocation improvements from #28980 while avoiding intermediate product Array.Direct SQL array literals passed to this function are represented as scalar fixed-size Arrays. Everywhere else, SQL array literals remain List-backed, avoiding global coercion changes. Query-vector form matches native one-row broadcasting, and #29000 can preserve scalar through dispatch and broadcast result without SQL-specific follow-up.
Coverage includes both aliases, mixed inner dtypes, literal syntax and argument position, all-null and constant literals, projection-height broadcasting, native plan shape, non-Array rejection, arity, and width validation.
Example:
Output: