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 2021/07/05 08:15:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17374653#comment-17374653 ] 

Apache Spark commented on SPARK-35929:
--------------------------------------

User 'itholic' has created a pull request for this issue:
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
>            Priority: Major
>
> 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