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 2018/01/07 06:39:00 UTC

[jira] [Commented] (SPARK-22981) Incorrect results of casting Struct to String

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

Apache Spark commented on SPARK-22981:
--------------------------------------

User 'maropu' has created a pull request for this issue:
https://github.com/apache/spark/pull/20176

> Incorrect results of casting Struct to String
> ---------------------------------------------
>
>                 Key: SPARK-22981
>                 URL: https://issues.apache.org/jira/browse/SPARK-22981
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.1
>            Reporter: Takeshi Yamamuro
>
> {code}
> scala> val df = Seq(((1, "a"), 0), ((2, "b"), 0)).toDF("a", "b")
> df: org.apache.spark.sql.DataFrame = [a: struct<_1: int, _2: string>, b: int]
> scala> df.write.saveAsTable("t")
>                                                                                 
> scala> sql("SELECT CAST(a AS STRING) FROM t").show
> +-------------------+
> |                  a|
> +-------------------+
> |[0,1,1800000001,61]|
> |[0,2,1800000001,62]|
> +-------------------+
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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