Skip to content
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

[native] Fix varchar cast for json #24396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

natashasehgal
Copy link
Contributor

@natashasehgal natashasehgal commented Jan 17, 2025

Description

Resolve error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

Motivation and Context

This is not due to missing function in Prestissimo, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Impact

N/A

Test Plan

  • Added unit test

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 ==

@natashasehgal natashasehgal requested a review from a team as a code owner January 17, 2025 23:06
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Jan 17, 2025
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

@natashasehgal natashasehgal marked this pull request as draft January 17, 2025 23:09
natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jan 21, 2025
Summary:

https://www.internalfb.com/tasks/?t=211442303

There was an error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

This is not due to missing function, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Related Diff: https://www.internalfb.com/diff/D59531026
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Differential Revision: D68353517
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

@amitkdutta
Copy link
Contributor

amitkdutta commented Jan 22, 2025

@natashasehgal Thanks for the fix. Please publish the PR, its in draft mode. Also make the PR title and commit message following
"[native] Fix varchar cast for json".

Lets also follow the PR template and fill in accordingly.

@natashasehgal natashasehgal marked this pull request as ready for review January 22, 2025 22:06
@natashasehgal natashasehgal changed the title Fix varchar cast for json [native] Fix varchar cast for json Jan 22, 2025
Copy link
Contributor

@amitkdutta amitkdutta left a comment

Choose a reason for hiding this comment

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

Looks good. Lets update the commit message also.

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jan 22, 2025
Summary:

https://www.internalfb.com/tasks/?t=211442303

There was an error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

This is not due to missing function, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Related Diff: https://www.internalfb.com/diff/D59531026
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Differential Revision: D68353517
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jan 22, 2025
Summary:

https://www.internalfb.com/tasks/?t=211442303

There was an error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

This is not due to missing function, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Related Diff: https://www.internalfb.com/diff/D59531026
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Differential Revision: D68353517
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

amitkdutta
amitkdutta previously approved these changes Jan 22, 2025
Copy link
Contributor

@amitkdutta amitkdutta left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks @natashasehgal

kgpai
kgpai previously approved these changes Jan 22, 2025
@gggrace14 gggrace14 self-requested a review January 23, 2025 06:27
Copy link
Contributor

@gggrace14 gggrace14 left a comment

Choose a reason for hiding this comment

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

Request double check

@gggrace14 gggrace14 self-requested a review January 23, 2025 06:32
natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jan 24, 2025
Summary:

https://www.internalfb.com/tasks/?t=211442303

There was an error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

This is not due to missing function, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Related Diff: https://www.internalfb.com/diff/D59531026
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Differential Revision: D68353517
@natashasehgal natashasehgal dismissed stale reviews from kgpai and amitkdutta via 997643c January 24, 2025 02:00
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jan 24, 2025
Summary:

https://www.internalfb.com/tasks/?t=211442303

There was an error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

This is not due to missing function, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Related Diff: https://www.internalfb.com/diff/D59531026
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Differential Revision: D68353517
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

@natashasehgal natashasehgal requested a review from kgpai January 24, 2025 02:07
Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

Looks good. Can you add an e2e test ?

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jan 24, 2025
Summary:

https://www.internalfb.com/tasks/?t=211442303

There was an error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

This is not due to missing function, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Related Diff: https://www.internalfb.com/diff/D59531026
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Differential Revision: D68353517
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

1 similar comment
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

Summary:

https://www.internalfb.com/tasks/?t=211442303

There was an error in running query on Prestissimo not Presto - "Scalar function presto.default.substr not registered with arguments: (JSON, BIGINT, BIGINT)".

This is not due to missing function, as the function signature does not exist in Presto. It occurs when attempting to cast JSON as varchar of capped length.
Related Diff: https://www.internalfb.com/diff/D59531026
Note: Exception is still raised for try_cast() behavior. Alignment is out of scope for this PR

Differential Revision: D68353517
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D68353517

@natashasehgal
Copy link
Contributor Author

Looks good. Can you add an e2e test ?

Yes. @kgpai could you please point me to a suitable location to add an e2e test? I wasn't able to find an e.g for presto-native-execution changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants