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

Wenchen Fan resolved SPARK-31023.
---------------------------------
    Fix Version/s: 3.1.0
       Resolution: Fixed

Issue resolved by pull request 27804
[https://github.com/apache/spark/pull/27804]

> Support foldable schemas by `from_json`
> ---------------------------------------
>
>                 Key: SPARK-31023
>                 URL: https://issues.apache.org/jira/browse/SPARK-31023
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Maxim Gekk
>            Assignee: Maxim Gekk
>            Priority: Minor
>             Fix For: 3.1.0
>
>
> Currently, Spark accepts only literals or schema_of_json w/ literal input as 
> the schema parameter of from_json. And it fails on any foldable expressions, 
> for instance:
> {code:sql}
> spark-sql> select from_json('{"id":1, "city":"Moscow"}', replace('dpt_org_id 
> INT, dpt_org_city STRING', 'dpt_org_', ''));
> Error in query: Schema should be specified in DDL format as a string literal 
> or output of the schema_of_json function instead of replace('dpt_org_id INT, 
> dpt_org_city STRING', 'dpt_org_', '');; line 1 pos 7
> {code}
> There are no reasons to restrict users by literals. The ticket aims to 
> support any foldable schemas by from_json().



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to