[
https://issues.apache.org/jira/browse/SPARK-62413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated SPARK-62413:
-----------------------------------
Labels: pull-request-available (was: )
> Avoid repeated parsing in JSON_TABLE
> ------------------------------------
>
> Key: SPARK-62413
> URL: https://issues.apache.org/jira/browse/SPARK-62413
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 4.3.0
> Reporter: Ganesha S
> Priority: Major
> Labels: pull-request-available
>
> For every input row, JSON_TABLE currently:
> * reads the whole document once to check that it is valid, then reads it
> again to find the rows
> * turns each array element back into JSON text and parses it again to extract
> the columns
> * turns each matched value into text and then casts that text to the column
> type
> This makes JSON_TABLE about 3.5x slower than from_json + explode even for a
> single level of nesting.
> Proposal: extract the columns while reading the document once, and convert
> values directly to the column types.
> Current behavior must be kept:
> * malformed input and trailing content after the JSON value follow the ON
> ERROR setting (today no rows are returned; a single-pass design needs to
> decide how to keep this)
> * a missing key and a JSON null are still told apart
> * for duplicate keys, the first value wins
> * decimal values keep their exact text
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]