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/10/04 04:23: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=17612475#comment-17612475 ] 

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

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

> 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
>            Priority: Major
>
> 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