Add support for map_keys_by_top_n_values#21259
Merged
ajaygeorge merged 1 commit intoprestodb:masterfrom Nov 29, 2023
Merged
Conversation
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 327ca59...84a0814.
|
steveburnett
requested changes
Oct 27, 2023
Contributor
steveburnett
left a comment
There was a problem hiding this comment.
Two small nits requested here. Looks good!
66cac33 to
eed6dd9
Compare
Contributor
Author
|
@steveburnett thanks a ton as always |
jaystarshot
reviewed
Oct 31, 2023
presto-main/src/main/java/com/facebook/presto/operator/scalar/sql/MapSqlFunctions.java
Outdated
Show resolved
Hide resolved
jaystarshot
reviewed
Oct 31, 2023
presto-main/src/main/java/com/facebook/presto/operator/scalar/sql/MapSqlFunctions.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@jaystarshot let me know if there are more concerns. Thanks in advance. |
kaikalur
requested changes
Nov 10, 2023
9c84fa7 to
4d5a81b
Compare
4d5a81b to
691efda
Compare
kaikalur
approved these changes
Nov 21, 2023
Contributor
Author
|
Hi @jaystarshot , if you could review the PR please. |
Contributor
|
Looking good. Let's merge it |
Contributor
Author
|
Can we please merge the PR? cc. @ajaygeorge , @NikhilCollooru |
ajaygeorge
approved these changes
Nov 28, 2023
Contributor
|
@jainavi17 one test is failing. Can you please rebase with master and rerun the tests. |
UDF to return the top n keys of a map by sorting its values in the descending order
691efda to
84a0814
Compare
Contributor
Author
|
@ajaygeorge done! |
Contributor
Author
|
@NikhilCollooru can we merge the changed please. TIA |
64 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.
Description
UDF to return the top N keys of a map by sorting its values in descending order
Motivation and Context
The existing map_top_n_keys provides the top n keys of a map by sorting its keys in the descending order. Based on the feedback received from the Presto Users, we have now added the support of returning top n keys of a map by value.
Test Plan
./mvnw clean install -Dtest=TestMapTopNKeysByValueFunction -Dmaven.javadoc.skip=true -T1C -fn -pl presto-main== RELEASE NOTES ==
General Changes
Add function :func:
map_top_n_keys_by_valueSELECT map_top_n_keys_by_value(map(ARRAY['a', 'b', 'c'], ARRAY[2, 1, 3]), 2); --- ['c', 'a']