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

Commits on Apr 23, 2024

  1. Make leading '$.' optional in JSON paths accepted by json_extract[_sc…

    …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 authored and facebook-github-bot committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    6ddb9b6 View commit details
    Browse the repository at this point in the history
  2. Allow redundant dots in JSON paths accepted by json_extract[_scalar] …

    …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
    mbasmanova authored and facebook-github-bot committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    c05d5fd View commit details
    Browse the repository at this point in the history