You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2026/08/17 17:38:00 UTC

[jira] [Assigned] (SPARK-58687) Support the ANSI SQL/JSON JSON_EXISTS function

     [ https://issues.apache.org/jira/browse/SPARK-58687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wenchen Fan reassigned SPARK-58687:
-----------------------------------

    Assignee: Ganesha S

>  Support the ANSI SQL/JSON JSON_EXISTS function
> -----------------------------------------------
>
>                 Key: SPARK-58687
>                 URL: https://issues.apache.org/jira/browse/SPARK-58687
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 4.3.0
>            Reporter: Ganesha S
>            Assignee: Ganesha S
>            Priority: Major
>              Labels: pull-request-available
>
> Add the ANSI SQL:2016 JSON_EXISTS predicate (feature T821):
> {code:java}
>   JSON_EXISTS(jsonExpr, path [ (TRUE | FALSE | UNKNOWN | ERROR) ON ERROR ]){code}
> Returns whether the SQL/JSON path matches at least one item:
> {code:java}
> * path matches (including an explicit JSON null) -> true
> * path matches nothing                            -> false
> * SQL NULL input                                  -> SQL NULL (Unknown, per 9075-2 8.23)
> * malformed input                                 -> ON ERROR behavior (default FALSE){code}
> Unlike `get_json_object(...) IS NOT NULL`, it distinguishes "present but null" from "absent". The ON ERROR clause selects `TRUE / FALSE / UNKNOWN (a BOOLEAN
> NULL) / ERROR`.
> Examples:
> {code:java}
>   JSON_EXISTS('{"a":{"b":1}}', '$.a.b')          -- true
>   JSON_EXISTS('{"a":null}', '$.a')               -- true
>   JSON_EXISTS('{"a":1}', '$.b')                  -- false
>   JSON_EXISTS('not json', '$.a' TRUE ON ERROR){code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org