Update the error type for ARRAY_NULL_ELEMENT_MSG#24570
Merged
duxiao1212 merged 1 commit intoprestodb:masterfrom Feb 19, 2025
Merged
Update the error type for ARRAY_NULL_ELEMENT_MSG#24570duxiao1212 merged 1 commit intoprestodb:masterfrom
duxiao1212 merged 1 commit intoprestodb:masterfrom
Conversation
zacw7
reviewed
Feb 15, 2025
presto-common/src/main/java/com/facebook/presto/common/type/TypeUtils.java
Outdated
Show resolved
Hide resolved
68736e3 to
04782fe
Compare
f4be12c to
f85d57b
Compare
rschlussel
requested changes
Feb 18, 2025
Contributor
rschlussel
left a comment
There was a problem hiding this comment.
This seems like a bit of a hacky solution. Can we instead have these checks throw INVALID_FUNCTION_ARGUMENT errors for all cases? These checks are only used for different array and map functions. and even if there were other cases, INVALID_FUNCTION_ARGUMENT seems a reasonable enough error code.
ec73dd5 to
daba822
Compare
rschlussel
reviewed
Feb 19, 2025
Contributor
rschlussel
left a comment
There was a problem hiding this comment.
Changes look good. Can you fix the commit message to match these guidelines https://cbea.ms/git-commit/
presto-main/src/test/java/com/facebook/presto/type/TestArrayOperators.java
Show resolved
Hide resolved
daba822 to
8f53947
Compare
Contributor
Author
Updated, thanks. |
rschlussel
approved these changes
Feb 19, 2025
Collaborator
|
@duxiao1212 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 25, 2025
Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: HeidiHan0000 Differential Revision: D70198160
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 25, 2025
…2447) Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, HeidiHan0000 Differential Revision: D70198160
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 26, 2025
Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, HeidiHan0000 Differential Revision: D70198160
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 26, 2025
…2447) Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, HeidiHan0000 Differential Revision: D70198160
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 26, 2025
…2447) Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, HeidiHan0000 Differential Revision: D70198160
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 26, 2025
…2447) Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, HeidiHan0000 Differential Revision: D70198160
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 26, 2025
…2447) Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, HeidiHan0000 Differential Revision: D70198160
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Feb 26, 2025
…2447) Summary: The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, yuandagits, HeidiHan0000 Differential Revision: D70198160
facebook-github-bot
pushed a commit
to facebookincubator/velox
that referenced
this pull request
Feb 26, 2025
Summary: Pull Request resolved: #12447 The fuzzer test for map_keys_by_top_n_values should be skipped until the presto array comparison null catch patch is fully released to the public. The only failure scenario occurs when the input value is an array with a null element, which is low risk and has already been fixed in this prestodb/presto#24570. Once the patch is fully rolled out, we can remove the method from the skip list. Reviewed By: kgpai, yuandagits, HeidiHan0000 Differential Revision: D70198160 fbshipit-source-id: 834457779074ab255ecbd28b77427a4ff75b7b74
This was referenced Mar 10, 2025
jp-sivaprasad
pushed a commit
to jp-sivaprasad/presto
that referenced
this pull request
Mar 10, 2025
30 tasks
pradeepvaka
pushed a commit
to pradeepvaka/presto
that referenced
this pull request
Apr 11, 2025
30 tasks
This was referenced May 6, 2025
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
Update the error type for ARRAY_NULL_ELEMENT_MSG to INVALID_FUNCTION_ARGUMENT in order to suppress the error for try(map_keys_by_top_n_values ...) when the value is an array with null.
This issue is also a continuation of our previous discussion, which can be found here: #23150 (comment)
Motivation and Context
Addressing the discrepancy with the try function related to map_keys_by_top_n_values. In Presto, we throw a NOT_SUPPORTED error (20250214_205756_02064_7wui9)

Whereas in Prestissimo, the error is suppressed, and null is returned.
The reason the try block isn't catching these errors is that Presto is using an incorrect error code when throwing exceptions for those functions. Specifically, it is throwing NOT_SUPPORTED errors instead of INVALID_FUNCTION_ARGUMENT errors. The try code does not catch NOT_SUPPORTED errors, and the try function does not catch these errors as shown in TryFunction.java from lines 166 to 170.
Impact
Low impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.