Ganesha S created SPARK-58730:
---------------------------------
Summary: Support the ANSI SQL/JSON JSON_ARRAY constructor function
Key: SPARK-58730
URL: https://issues.apache.org/jira/browse/SPARK-58730
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 4.3.0
Reporter: Ganesha S
Fix For: 4.4.0
Add the SQL:2016 JSON_ARRAY constructor (feature T811). It builds a JSON array
from an argument value list, controls null elements via (NULL | ABSENT) ON NULL
(default ABSENT ON NULL — the opposite of JSON_OBJECT, so NULL elements are
dropped), and supports an optional RETURNING type (STRING default). Nested
JSON_ARRAY / JSON_OBJECT compose.
Today, the only workaround is to_json(array(...)), which cannot express ABSENT
ON NULL and does not match the standard name used by Oracle, SQL Server
(2022+), MySQL, Trino, BigQuery, and DuckDB, forcing manual rewrites when
migrating.
Scope: add reserved token(s) and a dedicated SqlBaseParser production, an
AstBuilder visitor, a new Catalyst constructor expression reusing the existing
Jackson JSON-generation path (to_json / StructsToJsonEvaluator), a nullBehavior
enum, docs, and golden-file + unit test coverage. VARIANT RETURNING is deferred
(STRING-only v1).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]