Hao Ren created SPARK-25031:
-------------------------------
Summary: 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
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}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]