[
https://issues.apache.org/jira/browse/SPARK-40646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17638101#comment-17638101
]
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: [email protected]
For additional commands, e-mail: [email protected]