You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Summary:
This PR implements the enhancement requested in issue #55788, adding an optional third parameter limit to the SPLIT_BY_STRING function. The limit parameter controls the maximum number of splits to perform, limiting the size of the returned array.
Solution
Add optional third parameter limit to SPLIT_BY_STRING(<str>, <separator>[, <limit>])
When limit is positive: split from left, at most limit splits, returning at most limit + 1 elements
When limit is negative: split from right, at most |limit| splits from the end
When limit is not specified or -1: split all occurrences (backward compatible)
Update BE function implementation in function_string.cpp and function_string.h
Update FE function definition in SplitByString.java and StringArithmetic.java
Add constant folding support for the new parameter
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
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: close #55788
Related PR: #55788
Problem Summary:
This PR implements the enhancement requested in issue #55788, adding an optional third parameter
limitto theSPLIT_BY_STRINGfunction. Thelimitparameter controls the maximum number of splits to perform, limiting the size of the returned array.Solution
limittoSPLIT_BY_STRING(<str>, <separator>[, <limit>])limitis positive: split from left, at mostlimitsplits, returning at mostlimit + 1elementslimitis negative: split from right, at most|limit|splits from the endlimitis not specified or -1: split all occurrences (backward compatible)function_string.cppandfunction_string.hSplitByString.javaandStringArithmetic.javaExamples:
Release note
[Enhancement] Add optional
limitparameter toSPLIT_BY_STRINGfunction to control maximum number of splits.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)