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
Make leading '$.' optional in JSON paths accepted by json_extract[_scalar] Presto functions #9584
Closed
Conversation
This file contains 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
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Apr 23, 2024
This pull request was exported from Phabricator. Differential Revision: D56465662 |
✅ Deploy Preview for meta-velox canceled.
|
…alar] Presto functions (facebookincubator#9584) Summary: json_extract_scalar and json_extract Presto function allow paths like 'foo' and 'foo.bar'. These paths are non-standard. They are enabled via use of Jayway engine, which handles paths without leading '$' by prepending the path with '$.'. Path 'foo' becomes '$.foo'. However, this logic has some unexpected side effects. Path '.foo' becomes '$..foo', which uses deep scan operator '..' and matches 'foo' keys anywhere in the document, rather then just at the top level. This change allows Velox to support paths like 'foo' and 'foo.bar[2].bar', but not '.foo' or '[10]'. These paths are handled as if they contained leading '$.' characters. See prestodb/presto#22589 Part of facebookincubator#7049 Differential Revision: D56465662
mbasmanova
force-pushed
the
export-D56465662
branch
from
April 23, 2024 12:02
7ad90be
to
7963d7c
Compare
This pull request was exported from Phabricator. Differential Revision: D56465662 |
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this pull request
Apr 23, 2024
…alar] Presto functions (facebookincubator#9584) Summary: json_extract_scalar and json_extract Presto function allow paths like 'foo' and 'foo.bar'. These paths are non-standard. They are enabled via use of Jayway engine, which handles paths without leading '$' by prepending the path with '$.'. Path 'foo' becomes '$.foo'. However, this logic has some unexpected side effects. Path '.foo' becomes '$..foo', which uses deep scan operator '..' and matches 'foo' keys anywhere in the document, rather then just at the top level. This change allows Velox to support paths like 'foo' and 'foo.bar[2].bar', but not '.foo' or '[10]'. These paths are handled as if they contained leading '$.' characters. See prestodb/presto#22589 Part of facebookincubator#7049 Differential Revision: D56465662
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this pull request
Apr 23, 2024
…alar] Presto functions (facebookincubator#9584) Summary: json_extract_scalar and json_extract Presto function allow paths like 'foo' and 'foo.bar'. These paths are non-standard. They are enabled via use of Jayway engine, which handles paths without leading '$' by prepending the path with '$.'. Path 'foo' becomes '$.foo'. However, this logic has some unexpected side effects. Path '.foo' becomes '$..foo', which uses deep scan operator '..' and matches 'foo' keys anywhere in the document, rather then just at the top level. This change allows Velox to support paths like 'foo' and 'foo.bar[2].bar', but not '.foo' or '[10]'. These paths are handled as if they contained leading '$.' characters. See prestodb/presto#22589 Part of facebookincubator#7049 Differential Revision: D56465662
mbasmanova
added a commit
to mbasmanova/velox-1
that referenced
this pull request
Apr 23, 2024
…alar] Presto functions (facebookincubator#9584) Summary: json_extract_scalar and json_extract Presto function allow paths like 'foo' and 'foo.bar'. These paths are non-standard. They are enabled via use of Jayway engine, which handles paths without leading '$' by prepending the path with '$.'. Path 'foo' becomes '$.foo'. However, this logic has some unexpected side effects. Path '.foo' becomes '$..foo', which uses deep scan operator '..' and matches 'foo' keys anywhere in the document, rather then just at the top level. This change allows Velox to support paths like 'foo' and 'foo.bar[2].bar', but not '.foo' or '[10]'. These paths are handled as if they contained leading '$.' characters. See prestodb/presto#22589 Part of facebookincubator#7049 Differential Revision: D56465662
xiaoxmeng
approved these changes
Apr 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbasmanova LGTM. Thanks!
This pull request has been merged in 7e9550e. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
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.
Summary:
json_extract_scalar and json_extract Presto function allow paths like 'foo'
and 'foo.bar'. These paths are non-standard. They are enabled via use of Jayway
engine, which handles paths without leading '$' by prepending the path
with '$.'. Path 'foo' becomes '$.foo'. However, this logic has some unexpected
side effects. Path '.foo' becomes '$..foo', which uses deep scan operator '..'
and matches 'foo' keys anywhere in the document, rather then just at the top
level.
This change allows Velox to support paths like 'foo' and 'foo.bar[2].bar', but
not '.foo' or '[10]'. These paths are handled as if they contained leading '$.' characters.
See prestodb/presto#22589
Part of #7049
Differential Revision: D56465662