You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2021/07/07 06:15:00 UTC

[jira] [Resolved] (SPARK-35929) Schema inference of nested structs defaults to map

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

Hyukjin Kwon resolved SPARK-35929.
----------------------------------
    Fix Version/s: 3.3.0
       Resolution: Fixed

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

> Schema inference of nested structs defaults to map
> --------------------------------------------------
>
>                 Key: SPARK-35929
>                 URL: https://issues.apache.org/jira/browse/SPARK-35929
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 3.2.0
>            Reporter: Haejoon Lee
>            Assignee: Haejoon Lee
>            Priority: Major
>             Fix For: 3.3.0
>
>
> Inferring schema for struct columns causing schema issues as below.
> {code:java}
> data = [{"inside_struct": {"payment": 100.5, "name": "Lee"}}]
> df = spark.createDataFrame(data)
> df.show()
> +--------------------+
> |       inside_struct|
> +--------------------+
> |{name -> null, pa...|
> +--------------------+
> {code}
> The "inside_struct" is a map, and the "name" column inside of it becomes null.
> The schema inferring might decide on a map type with a value type of the first field of the struct, we should fix it.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org