Adding support for all_key_match#19853
Merged
rschlussel merged 1 commit intoprestodb:masterfrom Jun 22, 2023
Merged
Conversation
80378fc to
5b29110
Compare
Contributor
Author
|
@feilong-liu If you could review the diff. |
feilong-liu
requested changes
Jun 9, 2023
presto-main/src/test/java/com/facebook/presto/operator/scalar/sql/TestAllKeysMatchFunction.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/com/facebook/presto/operator/scalar/sql/TestAllKeysMatchFunction.java
Outdated
Show resolved
Hide resolved
Contributor
|
Nit, remove the "::" at the end of the release note description. |
feilong-liu
approved these changes
Jun 12, 2023
Member
|
Please update release notes base on the guidelines: https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines#phrasing for example == RELEASE NOTES ==
|
rschlussel
approved these changes
Jun 20, 2023
Contributor
|
Also, the commit message should follow the guidelines in the blog linked here: https://github.com/prestodb/presto/wiki/Review-and-Commit-guidelines#commit-formatting-and-pull-requests. So, the commit message title should be "Add support for all_keys_match function" (rather than "Adding"). And then the body can have a brief description. |
UDF to check if all the keys present in the map matches the given predicate
28 tasks
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.
Returns whether all keys of a map match the given predicate. Returns true if all the keys match the predicate (a special case is when the map is empty); false if one or more keys don’t match; NULL if the predicate function returns NULL for one or more keys and true for all other keys.
Test plan
Added unit tests.
Build successfully using the following terminal command
./mvnw clean install -Dtest=TestAllKeysMatchFunction -fn -pl presto-main== RELEASE NOTES ==
General Changes
Add support for ALL_KEYS_MATCH udf in Presto
SELECT ALL_KEYS_MATCH(map(ARRAY['a', 'b', 'c'], ARRAY[1, 2, 3]), x -> length(x) = 1); -- true