[ 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-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org