-
Notifications
You must be signed in to change notification settings - Fork 179
Support split eval function
#4814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dai-chen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be reused? https://issues.apache.org/jira/browse/CALCITE-6951
|
Hi @dai-chen , currently we are using Here's the documentation for Calcite Returns the string array of string split at delimiter (if omitted, default is comma). If the string is empty it returns an empty array, otherwise, if the delimiter is empty, it returns an array containing the original string. |
I see. So the only reason of
|
|
@dai-chen Thanks for the suggestion! I think it makes sense. I have updated the PR to move the implementation to |
dai-chen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes!
Signed-off-by: Kai Huang <[email protected]> # Conflicts: # core/src/main/java/org/opensearch/sql/expression/function/BuiltinFunctionName.java # integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteArrayFunctionIT.java # ppl/src/main/antlr/OpenSearchPPLLexer.g4 # ppl/src/main/antlr/OpenSearchPPLParser.g4 # ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLArrayFunctionTest.java # ppl/src/test/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizerTest.java
Signed-off-by: Kai Huang <[email protected]>
Signed-off-by: Kai Huang <[email protected]>
Signed-off-by: Kai Huang <[email protected]>
aa898e5 to
444cb29
Compare
Summary
This PR implements the
spliteval function for PPL, enabling users to split strings into multivalue arrays based on a delimiter.Examples
Basic split with semicolon
Result:
['a', 'b', 'c']Split into individual characters (empty delimiter)
Result:
['a', 'b', 'c', 'd']Multi-character delimiter
Result:
['name', 'value']Split field value
Splits the
employerfield on spaces.Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.