[feature](function) Support map arguments for inner_product - #67311
Open
BiteTheDDDDt wants to merge 1 commit into
Open
[feature](function) Support map arguments for inner_product#67311BiteTheDDDDt wants to merge 1 commit into
BiteTheDDDDt wants to merge 1 commit into
Conversation
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Extend inner_product to compute sparse vector dot products represented as MAP<K, FLOAT>. Map keys are limited to integral and string types and use native typed dispatch with direct key access and hashing, without serialization or type erasure. Dense ARRAY<FLOAT> behavior remains unchanged.
### Release note
Support inner_product for MAP<K, FLOAT> arguments with integral or string keys.
### Check List (For Author)
- Test:
- Regression test: test_map_inner_product
- Unit Test: FunctionMapInnerProductTest.* (6 tests, ASAN)
- Build: ./build.sh --be and ./build.sh --fe
- Behavior changed: Yes. inner_product now accepts compatible MAP arguments.
- Does this need documentation: No.
BiteTheDDDDt
requested review from
924060929,
englefly,
morrySnow and
starocean999
as code owners
August 29, 2026 16:18
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
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.
What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary:
inner_productcurrently only accepts denseARRAY<FLOAT>vectors. This PR extends it to sparse vectors represented asMAP<K, FLOAT>, where matching map keys identify dimensions.Map keys are intentionally limited to integral and string types. The BE dispatches to concrete native key types and hashes keys directly: numeric keys use their native column data, while string keys use zero-copy
StringRefaccess. The implementation does not serialize keys or use runtime type erasure. For each row, it builds a flat hash map from the smaller input map and probes it with the larger map, using O(m + n) time and O(min(m, n)) temporary space. Existing dense array behavior remains unchanged.The implementation also validates unsupported key types in FE and BE, preserves NULL-key matching, and rejects NULL map values and NULL outer maps.
Release note
Support
inner_product(MAP<K, FLOAT>, MAP<K, FLOAT>)for integral and string key types.Check List (For Author)
test_map_inner_productFunctionMapInnerProductTest.*(6 tests under ASAN)Additional validation:
DISABLE_BE_CDC_CLIENT=ON ./build.sh --beDISABLE_BUILD_UI=ON ./build.sh --febuild-support/check-build-hygiene.shbuild-support/check-format.shBehavior changed:
inner_productnow accepts compatible MAP arguments in addition to ARRAY arguments.Does this need documentation?
Check List (For Reviewer who merge this PR)