Skip to content

Revert "Change array_top_n to return null on bad n" #25101

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

aditi-pandit
Copy link
Contributor

@aditi-pandit aditi-pandit commented May 13, 2025

Reverts #24729

array_top_n is a SQL function in Presto, vs Velox has a native implementation. Both implementations throw Exception for n < 0, which is consistent. https://github.com/facebookincubator/velox/blob/main/velox/functions/prestosql/ArrayFunctions.h#L755

The issue is mostly because Presto Java doesn't process "try" correctly on SQL functions in general. We should investigate at that broad level. The current fix is incorrect imo.

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label May 13, 2025
@aditi-pandit aditi-pandit marked this pull request as ready for review May 13, 2025 17:19
@aditi-pandit aditi-pandit requested a review from a team as a code owner May 13, 2025 17:19
@aditi-pandit aditi-pandit requested a review from hantangwangd May 13, 2025 17:19
@prestodb-ci prestodb-ci requested review from a team, nmahadevuni and pratyakshsharma and removed request for a team May 13, 2025 17:19
@aditi-pandit aditi-pandit requested a review from ZacBlanco May 13, 2025 17:20
@aditi-pandit aditi-pandit merged commit 52fae25 into master May 13, 2025
99 of 100 checks passed
@aditi-pandit aditi-pandit deleted the revert-24729-array-top-n branch May 13, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:IBM PR from IBM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants