Skip to content

Add alias any_value for arbitrary#21389

Merged
tdcmeehan merged 1 commit intoprestodb:masterfrom
shenh062326:any_value
Nov 16, 2023
Merged

Add alias any_value for arbitrary#21389
tdcmeehan merged 1 commit intoprestodb:masterfrom
shenh062326:any_value

Conversation

@shenh062326
Copy link
Copy Markdown
Contributor

@shenh062326 shenh062326 commented Nov 15, 2023

Description

There is any_value in mysql, which returns any value in a group. It has the same semantics as presto's arbitrary, so we hope to add an alias any_value to arbitrary.

Motivation and Context

Some users are accustomed to the syntax of MySQL. When using presto, they find that the any_value function does not exist and can only be replaced by arbitrary. If any_value exists, it will be more friendly to users who are accustomed to the MySQL syntax.

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@shenh062326 shenh062326 requested a review from a team as a code owner November 15, 2023 08:26
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Nov 15, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: shenh062326 / name: HongShen (5838d71)

@steveburnett
Copy link
Copy Markdown
Contributor

Consider adding documentation for this. Perhaps a good location would be immediately following the entry for arbitrary(x) in Aggregate Functions.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 16, 2023

Codenotify: Notifying subscribers in CODENOTIFY files for diff 27c6d9e...5838d71.

Notify File(s)
@steveburnett presto-docs/src/main/sphinx/functions/aggregate.rst

@jaystarshot
Copy link
Copy Markdown
Member

Can you add a small unit test around this? Seems trivial

@shenh062326
Copy link
Copy Markdown
Contributor Author

Consider adding documentation for this. Perhaps a good location would be immediately following the entry for arbitrary(x) in Aggregate Functions.

Thanks for you comment, add documentation.

@shenh062326
Copy link
Copy Markdown
Contributor Author

Can you add a small unit test around this? Seems trivial

Thanks for you comment, add TestAnyValueAggregation.

Copy link
Copy Markdown
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (docs)

Thank you for adding the documentation!

@tdcmeehan tdcmeehan merged commit 6470fd5 into prestodb:master Nov 16, 2023
amitkdutta pushed a commit to amitkdutta/velox that referenced this pull request Nov 22, 2023
Summary:

Presto added `any_value` alias for arbitrary aggregate in
prestodb/presto#21389

Differential Revision: D51521293
facebook-github-bot pushed a commit to facebookincubator/velox that referenced this pull request Nov 22, 2023
Summary:
Pull Request resolved: #7689

Presto added `any_value` alias for arbitrary aggregate in
prestodb/presto#21389

Reviewed By: mbasmanova

Differential Revision: D51521293

fbshipit-source-id: 64c219bc4ba18df65d2e77210405fa23e704d951
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants