Skip to content

Commit

Permalink
Back out "fix(json): Ensure input is parsed as json for json extract …
Browse files Browse the repository at this point in the history
…functions" (#12514)

Summary:
Pull Request resolved: #12514

Temporarily backing out this change as it is failing some internal unit tests.

Reviewed By: kgpai

Differential Revision: D70498020

fbshipit-source-id: 1137958fb0c87e4e53bc78bb12ea16c75124aeff
  • Loading branch information
Bikramjeet Vig authored and facebook-github-bot committed Mar 3, 2025
1 parent 152e624 commit 55257c2
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 538 deletions.
11 changes: 2 additions & 9 deletions velox/docs/functions/presto/json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ JSON Functions
SELECT json_extract(json, '$.store.book');

Current implementation supports limited subset of JSONPath syntax.
If ``json`` is a varchar then it is expected to conform to `RFC 7159`_ and will be converted to its canonical
format before extraction.

.. _JSONPath: http://goessner.net/articles/JsonPath/

Expand All @@ -171,10 +169,6 @@ JSON Functions
SELECT json_extract_scalar('[1, 2, 3]', '$[2]');
SELECT json_extract_scalar(json, '$.store.book[0].author');

Current implementation supports limited subset of JSONPath syntax.
If ``json`` is a varchar then it is expected to conform to `RFC 7159`_ and will be converted to its canonical
format before extraction.

.. _JSONPath: http://goessner.net/articles/JsonPath/

.. function:: json_format(json) -> varchar
Expand All @@ -189,9 +183,8 @@ JSON Functions

.. function:: json_parse(varchar) -> json

Expects a JSON text conforming to `RFC 7159`_, and returns the JSON value (in its canonical form) deserialized
from the JSON text. The JSON value can be a JSON object, a JSON array, a JSON string, a JSON number, ``true``,
``false`` or ``null``::
expects a JSON text conforming to `RFC 7159`_, and returns the JSON value deserialized from the JSON text.
The JSON value can be a JSON object, a JSON array, a JSON string, a JSON number, ``true``, ``false`` or ``null``::

SELECT json_parse('[1, 2, 3]'); -- JSON '[1,2,3]'
SELECT json_parse('"abc"'); -- JSON '"abc"'
Expand Down
Loading

0 comments on commit 55257c2

Please sign in to comment.