Support mvdedup eval function#4828
Merged
dai-chen merged 4 commits intoopensearch-project:mainfrom Nov 24, 2025
Merged
Conversation
Signed-off-by: Kai Huang <ahkcs@amazon.com>
Signed-off-by: Kai Huang <ahkcs@amazon.com>
ykmr1224
reviewed
Nov 20, 2025
core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/MVDedupCore.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/opensearch/sql/expression/function/CollectionUDF/MVDedupFunctionImpl.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/opensearch/sql/expression/function/CollectionUDF/MVDedupFunctionImpl.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/MVDedupCore.java
Outdated
Show resolved
Hide resolved
dai-chen
reviewed
Nov 20, 2025
Collaborator
dai-chen
left a comment
There was a problem hiding this comment.
Could you check if this has same semantic as ARRAY_DISTINCT?
2: jdbc:calcite:model=src/test/resources/mode> SELECT ARRAY_DISTINCT(ARRAY[1,2,1,3,3,4]);
+--------------+
| EXPR$0 |
+--------------+
| [1, 2, 3, 4] |
+--------------+
1 row selected (0.018 seconds)
2: jdbc:calcite:model=src/test/resources/mode> SELECT ARRAY_DISTINCT(ARRAY[4,1,2,1,3,3,4]);
+--------------+
| EXPR$0 |
+--------------+
| [4, 1, 2, 3] |
+--------------+
Signed-off-by: Kai Huang <ahkcs@amazon.com>
Collaborator
Author
Hi @dai-chen, thanks for the suggestion! After checking, I think cc @ykmr1224 |
ykmr1224
approved these changes
Nov 20, 2025
dai-chen
approved these changes
Nov 21, 2025
Collaborator
dai-chen
left a comment
There was a problem hiding this comment.
Thanks for the changes!
Collaborator
|
Do we need to backport? |
Collaborator
Author
Yes |
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Nov 24, 2025
* Support eval function Signed-off-by: Kai Huang <ahkcs@amazon.com> * Updates Signed-off-by: Kai Huang <ahkcs@amazon.com> * update javadoc Signed-off-by: Kai Huang <ahkcs@amazon.com> * Update to use ARRAY_DISTINCT Signed-off-by: Kai Huang <ahkcs@amazon.com> --------- Signed-off-by: Kai Huang <ahkcs@amazon.com> (cherry picked from commit 5049a03) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
LantaoJin
pushed a commit
that referenced
this pull request
Nov 25, 2025
* Support eval function * Updates * update javadoc * Update to use ARRAY_DISTINCT --------- (cherry picked from commit 5049a03) Signed-off-by: Kai Huang <ahkcs@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
asifabashar
pushed a commit
to asifabashar/sql
that referenced
this pull request
Dec 10, 2025
* Support eval function Signed-off-by: Kai Huang <ahkcs@amazon.com> * Updates Signed-off-by: Kai Huang <ahkcs@amazon.com> * update javadoc Signed-off-by: Kai Huang <ahkcs@amazon.com> * Update to use ARRAY_DISTINCT Signed-off-by: Kai Huang <ahkcs@amazon.com> --------- Signed-off-by: Kai Huang <ahkcs@amazon.com>
This was referenced Jan 11, 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.
Description
This PR implements the
mvdedupeval function for PPL, enabling users to remove duplicate values from multivalue arrays.Behavior
Given the input:
The function returns:
Key Details
Empty arrays return empty arrays
Order-preserving: The first appearance of each value is kept; subsequent duplicates are removed.
Example
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.