Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Incomplete
-
2.3.0
-
None
-
OS: SUSE11
Spark Version: 2.3
Description
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: ALTER TABLE CHANGE COLUMN is not supported for changing column 'a' with type 'IntegerType' to 'b' with type 'IntegerType'; (state=,code=0) - 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/> alter table del1 change a1 a bigint;
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
Attachments
Issue Links
- is duplicated by
-
SPARK-26521 Sparksql cannot modify the field name of a table
- Closed
- is related to
-
SPARK-26519 spark sql CHANGE COLUMN not working
- Resolved