You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/11/24 05:17:00 UTC

[jira] [Commented] (SPARK-40646) Fix returning partial results in JSON data source and JSON functions

    [ https://issues.apache.org/jira/browse/SPARK-40646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17638100#comment-17638100 ] 

Apache Spark commented on SPARK-40646:
--------------------------------------

User 'sadikovi' has created a pull request for this issue:
https://github.com/apache/spark/pull/38784

> Fix returning partial results in JSON data source and JSON functions
> --------------------------------------------------------------------
>
>                 Key: SPARK-40646
>                 URL: https://issues.apache.org/jira/browse/SPARK-40646
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Ivan Sadikov
>            Assignee: Ivan Sadikov
>            Priority: Major
>             Fix For: 3.4.0
>
>
> I recently found an issue when parsing the following JSON file:
> {code:java}
> {"a": {"x": 1, "y": true}, "b": {"x": 1}}
> {"a": {"x": 2}, "b": {"x": 2}}{code}
> Trying to read such table with fixed schema where {{y}} is a struct column and not a boolean: 
> {code:java}
> val df = spark.read
>   .schema("a struct<x: int, y: struct<x: int>>, b struct<x: int>")
>   .json("path") {code}
> results in the following answer:
> {code:java}
> a	                 b
> null	                 null
> {"x":2,"y":null}	{"x":2} {code}
> Column {{b}} is valid and should be still parsed despite {{a}} having the wrong value.
>  
> This could be considered a follow-up to https://issues.apache.org/jira/browse/SPARK-33134.



--
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