You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "shivusondur (JIRA)" <ji...@apache.org> on 2018/10/10 14:25:00 UTC

[jira] [Issue Comment Deleted] (SPARK-24602) In Spark SQL, ALTER TABLE--CHANGE column1 column2 datatype is not supported in 2.3.1

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

shivusondur updated SPARK-24602:
--------------------------------
    Comment: was deleted

(was: i am working on this issue)

> In Spark SQL, ALTER TABLE--CHANGE column1 column2 datatype is not supported in 2.3.1
> ------------------------------------------------------------------------------------
>
>                 Key: SPARK-24602
>                 URL: https://issues.apache.org/jira/browse/SPARK-24602
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.3.0
>         Environment: OS: SUSE11
> Spark Version: 2.3
>            Reporter: Sushanta Sen
>            Priority: Major
>
> Precondition:
> Spark cluster 2.3 is up and running
> Test Steps:
>  # Launch Spark-sql
>  # spark-sql> CREATE TABLE t1(a int,string)                                                                 0: jdbc:hive2://ha-cluster/default> *alter table t1 change a a1 int;*
> Error: org.apache.spark.sql.AnalysisException: {color:#FF0000}ALTER TABLE CHANGE COLUMN is not supported for changing column 'a' with type 'IntegerType' to 'b' with type 'IntegerType'; (state=,code=0){color}
>  # Launch hive beeliine
>  # repeat step1 & 2
>  # 0: jdbc:hive2://10.18.108.126:10000/> desc del1;
> +-----------+------------+----------+--+
> | col_name  | data_type  | comment  |
> +-----------+------------+----------+--+
> | *a1*        | *int*        |          |
> | dob       | int        |          |
> +-----------+------------+----------+--+
> 2 rows selected (1.572 seconds)
> 0: jdbc:hive2://10.18.108.126:10000/>{color:#205081} alter table del1 change a1 a bigint;{color}
> No rows affected (0.425 seconds)
> 0: jdbc:hive2://10.18.108.126:10000/> desc del1;
> +-----------+------------+----------+--+
> | col_name  | data_type  | comment  |
> +-----------+------------+----------+--+
> | *a*         | *bigint*     |          |
> | dob       | int        |          |
> +-----------+------------+----------+--+
> 2 rows selected (0.364 seconds)
>  
> Actual Result: In spark sql, alter table change is not supported, whereas in hive beeline it is working fine.
> Expected Result: ALTER Table CHANGE should be supported in Spark-SQL as well



--
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