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

Allow redundant dots in JSON paths accepted by json_extract[_scalar] Presto #9585

Closed

Conversation

mbasmanova
Copy link
Contributor

Summary:
json_extract_scalar and json_extract Presto function allow paths like '$.[0].
[1].[2].foo' that include "redundant" dots before opening brackets. These paths
are non-standard. They are enabled via use of Jayway engine.

This change allows Velox to support these paths by ignoring dots that appear
before opening brackets.

See prestodb/presto#22589 Part of
#7049

Differential Revision: D56467690

@facebook-github-bot 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
@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Apr 23, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit c05d5fd
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/662806490b35de0008092d89

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

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

@mbasmanova LGTM % nit!

/// equivalent. This is not part of JSONPath syntax, but this is the behavior of
/// Jayway implementation used by Presto.
///
/// It is allowed to use dot-notation redundantly, e.g. non-standaed path
Copy link
Contributor

Choose a reason for hiding this comment

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

s/standaed/standard/

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

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

@mbasmanova LGMT. Thanks!

mbasmanova added a commit to mbasmanova/velox-1 that referenced this pull request Apr 23, 2024
…Presto (facebookincubator#9585)

Summary:

json_extract_scalar and json_extract Presto function allow paths like '$.[0].
[1].[2].foo' that include "redundant" dots before opening brackets. These paths
are non-standard. They are enabled via use of Jayway engine. 

This change allows Velox to support these paths by ignoring dots that appear
before opening brackets.

See prestodb/presto#22589 Part of
facebookincubator#7049

Reviewed By: xiaoxmeng

Differential Revision: D56467690
…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
…Presto (facebookincubator#9585)

Summary:

json_extract_scalar and json_extract Presto function allow paths like '$.[0].
[1].[2].foo' that include "redundant" dots before opening brackets. These paths
are non-standard. They are enabled via use of Jayway engine. 

This change allows Velox to support these paths by ignoring dots that appear
before opening brackets.

See prestodb/presto#22589 Part of
facebookincubator#7049

Reviewed By: xiaoxmeng

Differential Revision: D56467690
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 2a67b6e.

Copy link

Conbench analyzed the 1 benchmark run on commit 2a67b6e5.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants