Support trim_array function - #67397
Open
vajaw wants to merge 1 commit into
Open
Conversation
Implement trim_array in BE and register its Nereids signature. Add constant folding, BE tests for const-column combinations, and regression coverage for nulls, nested arrays, boundary sizes, and types. Related to apache#48203
vajaw
requested review from
924060929,
englefly,
morrySnow and
starocean999
as code owners
September 1, 2026 12:52
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Author
|
/review |
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: Related to #48203
Related PR:
apache/doris-website#4106
Problem Summary:
Add the
trim_array(array, n)scalar function. The BE implementationtrims trailing elements directly from array storage and avoids virtual
function calls in the hot loop.
Register the function and its signature in the Nereids planner. Add FE
constant folding so constant invocations can be evaluated during
planning.
Cover normal and constant columns, NULL values, nullable elements,
nested arrays, multiple element types, zero, negative and out-of-range
sizes, and the maximum BIGINT value.
Release note
Add the TRIM_ARRAY scalar function.
Check List (For Author)
Test results:
BE ASAN build passed.
FunctionArrayTrimTest.all_argument_combinationspassed.FE unit tests passed: 2 tests, 0 failures and 0 errors.
The trim_array regression suite passed with no mismatches.
run-be-ut.shandrun-regression-test.shcompletedsuccessfully for the relevant tests.
Behavior changed:
trim_arrayscalar function.Does this need documentation?
Add trim_array function documentation doris-website#4106
Check List (For Reviewer who merge this PR)