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 2020/05/17 15:11:00 UTC

[jira] [Commented] (SPARK-31737) SparkSQL can't recognize the modified length of Hive varchar

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

Apache Spark commented on SPARK-31737:
--------------------------------------

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

> SparkSQL can't recognize the modified length of Hive varchar
> ------------------------------------------------------------
>
>                 Key: SPARK-31737
>                 URL: https://issues.apache.org/jira/browse/SPARK-31737
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Kevin Zhang
>            Priority: Major
>
> {code:java}
> //Create a hive table in sparksql
> spark-sql> create table test_table(id varchar(5)) stored as textfile;
> // Create a file under linux, the content is 1234567890
> // Then load this file into this hive table
> spark-sql> load data local inpath '/home/test_table' overwrite into table test_table;
> // Query this table in sparksql
> spark-sql> select * from test_table;
> 12345
> // Modify the length of this field in hive
> hive> alter table test_table change column id id varchar(10);
> // Query this table in hive
> hive> select * from test_table;
> OK
> 1234567890
> // Query this table in sparksql again
> spark-sql> select * from test_table;
> // The obtained id is still 12345, so the length modification does not take effect in SparkSQL
> 12345{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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