spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dongjoon Hyun (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SPARK-25824) Remove duplicated map entries in `showString`
Date Wed, 24 Oct 2018 18:48:00 GMT
Dongjoon Hyun created SPARK-25824:
-------------------------------------

             Summary: Remove duplicated map entries in `showString`
                 Key: SPARK-25824
                 URL: https://issues.apache.org/jira/browse/SPARK-25824
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Dongjoon Hyun


`showString` doesn't eliminate the duplication. So, it looks different from the result of
`collect` and select from saved rows.

*Spark 2.2.2*
{code}
spark-sql> select map(1,2,1,3);
{1:3}

scala> sql("SELECT map(1,2,1,3)").collect
res0: Array[org.apache.spark.sql.Row] = Array([Map(1 -> 3)])

scala> sql("SELECT map(1,2,1,3)").show
+---------------+
|map(1, 2, 1, 3)|
+---------------+
|    Map(1 -> 3)|
+---------------+
{code}

*Spark 2.3.0 ~ 2.4.0-rc4*
{code}
spark-sql> select map(1,2,1,3);
{1:3}

scala> sql("SELECT map(1,2,1,3)").collect
res1: Array[org.apache.spark.sql.Row] = Array([Map(1 -> 3)])

scala> sql("CREATE TABLE m AS SELECT map(1,2,1,3) a")
scala> sql("SELECT * FROM m").show
+--------+
|       a|
+--------+
|[1 -> 3]|
+--------+

scala> sql("SELECT map(1,2,1,3)").show
+----------------+
| map(1, 2, 1, 3)|
+----------------+
|[1 -> 2, 1 -> 3]|
+----------------+
{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