You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sushanta Sen (JIRA)" <ji...@apache.org> on 2018/06/20 08:21:00 UTC
[jira] [Created] (SPARK-24602) In Spark SQL, ALTER TABLE--CHANGE
column1 column2 datatype is not supported in 2.3.1
Sushanta Sen created SPARK-24602:
------------------------------------
Summary: 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
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