spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Gaido (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-25031) The schema of MapType can not be printed correctly
Date Wed, 08 Aug 2018 14:42:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-25031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16573299#comment-16573299
] 

Marco Gaido commented on SPARK-25031:
-------------------------------------

[~smilegator] shall this be resolved as https://github.com/apache/spark/pull/22006 was merged?
Thanks.

> The schema of MapType can not be printed correctly
> --------------------------------------------------
>
>                 Key: SPARK-25031
>                 URL: https://issues.apache.org/jira/browse/SPARK-25031
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.3.1
>            Reporter: Hao Ren
>            Priority: Minor
>              Labels: easyfix
>
> Something wrong with the function `buildFormattedString` in `MapType`
>  
> {code:java}
> import spark.implicits._
> case class Key(a: Int)
> case class Value(b: Int)
> Seq(
>   (1, Map(Key(1) -> Value(2))), 
>   (2, Map(Key(1) -> Value(2)))
> ).toDF("id", "dict").printSchema
> {code}
> The result is:
> {code:java}
> root
> |-- id: integer (nullable = false)
> |-- dict: map (nullable = true)
> | |-- key: struct
> | |-- value: struct (valueContainsNull = true)
> | | |-- a: integer (nullable = false)
> | | |-- b: integer (nullable = false)
> {code}
>  The expected is
> {code:java}
> root
> |-- id: integer (nullable = false)
> |-- dict: map (nullable = true)
> | |-- key: struct
> | | |-- a: integer (nullable = false)
> | |-- value: struct (valueContainsNull = true)
> | | |-- b: integer (nullable = false)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message