You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Max Gekk (Jira)" <ji...@apache.org> on 2022/10/17 08:48:00 UTC
[jira] [Resolved] (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:all-tabpanel ]
Max Gekk resolved SPARK-40646.
------------------------------
Fix Version/s: 3.4.0
Resolution: Fixed
Issue resolved by pull request 38090
[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
> 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