spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (SPARK-23774) `Cast` to CHAR/VARCHAR should truncate the values
Date Thu, 22 Mar 2018 23:21:00 GMT

     [ https://issues.apache.org/jira/browse/SPARK-23774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Apache Spark reassigned SPARK-23774:
------------------------------------

    Assignee: Apache Spark

> `Cast` to CHAR/VARCHAR should truncate the values
> -------------------------------------------------
>
>                 Key: SPARK-23774
>                 URL: https://issues.apache.org/jira/browse/SPARK-23774
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.1, 2.3.0
>            Reporter: Dongjoon Hyun
>            Assignee: Apache Spark
>            Priority: Major
>
> This issue aims to fix the following `CAST` behavior on `CHAR/VARCHAR` types.
> *Spark*
> {code}
> scala> sql("SELECT CAST('123' AS CHAR(1)), CAST('123' AS VARCHAR(1))").show
> +-------------------+-------------------+
> |CAST(123 AS STRING)|CAST(123 AS STRING)|
> +-------------------+-------------------+
> |                123|                123|
> +-------------------+-------------------+
> {code}
> *Hive*
> {code}
> hive> SELECT CAST('123' AS CHAR(1)), CAST('123' AS VARCHAR(1));
> OK
> 1	1
> {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