Skip to content

Update the error type for ARRAY_NULL_ELEMENT_MSG#24570

Merged
duxiao1212 merged 1 commit intoprestodb:masterfrom
duxiao1212:T215381580
Feb 19, 2025
Merged

Update the error type for ARRAY_NULL_ELEMENT_MSG#24570
duxiao1212 merged 1 commit intoprestodb:masterfrom
duxiao1212:T215381580

Conversation

@duxiao1212
Copy link
Contributor

@duxiao1212 duxiao1212 commented Feb 15, 2025

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)
image
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

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • 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 ==

@duxiao1212 duxiao1212 force-pushed the T215381580 branch 2 times, most recently from 68736e3 to 04782fe Compare February 15, 2025 23:50
@duxiao1212 duxiao1212 requested a review from a team as a code owner February 15, 2025 23:50
@duxiao1212 duxiao1212 force-pushed the T215381580 branch 3 times, most recently from f4be12c to f85d57b Compare February 16, 2025 23:30
Copy link
Contributor

@rschlussel rschlussel left a comment

Choose a reason for hiding this comment

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

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.

@duxiao1212 duxiao1212 force-pushed the T215381580 branch 2 times, most recently from ec73dd5 to daba822 Compare February 18, 2025 22:56
Copy link
Contributor

@rschlussel rschlussel left a comment

Choose a reason for hiding this comment

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

Changes look good. Can you fix the commit message to match these guidelines https://cbea.ms/git-commit/

@duxiao1212
Copy link
Contributor Author

Changes look good. Can you fix the commit message to match these guidelines https://cbea.ms/git-commit/

Updated, thanks.

@duxiao1212 duxiao1212 merged commit ea7dfa8 into prestodb:master Feb 19, 2025
53 checks passed
@facebook-github-bot
Copy link
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
jp-sivaprasad pushed a commit to jp-sivaprasad/presto that referenced this pull request Mar 10, 2025
@prestodb-ci prestodb-ci mentioned this pull request Mar 28, 2025
30 tasks
pradeepvaka pushed a commit to pradeepvaka/presto that referenced this pull request Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:Meta PR from Meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants