forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix json_extract for non-definite paths (paths with wildcards)
Summary: In Presto, paths with wildcards are handled by Jayway engine. It always returns an array for such paths, even if only one entry matches. Non-definite paths matching zero or one entry: ``` presto:di> select json_extract('{"a": [{"b": 123}]}', '$.a[*].b'); _col0 ------- [123] presto:di> select json_extract('{"a": [{"b": 123}]}', '$.a[*].c'); _col0 ------- [] ``` "Equivalent" define paths: ``` presto:di> select json_extract('{"a": [{"b": 123}]}', '$.a[0].b'); _col0 ------- 123 presto:di> select json_extract('{"a": [{"b": 123}]}', '$.a[0].c'); _col0 ------- NULL ``` Reviewed By: Yuhta Differential Revision: D56529345 fbshipit-source-id: 13b5d3a9de852a7b33b28fcecf7b5cf175213317
- Loading branch information
1 parent
abfcf12
commit 4e075a0
Showing
5 changed files
with
64 additions
and
46 deletions.
There are no files selected for viewing
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
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
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
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
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