Details
-
Sub-task
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.4.5
-
None
-
None
Description
Support alter table with drop column in spark also like in postgresql.
https://www.postgresql.org/docs/12/sql-altertable.html
alter table tablename DROP COLUMN/columns [ IF EXISTS ]
columnname
spark-sql> drop database if exists hivemetastoretest cascade; Time taken: 1.067 seconds spark-sql> create database hivemetastoretest; Time taken: 0.326 seconds spark-sql> use hivemetastoretest; Time taken: 0.053 seconds spark-sql> create table jobit4 using parquet as select 2.5; Time taken: 5.058 seconds spark-sql> alter table jobit4 add columns(name string); Time taken: 1.194 seconds spark-sql> alter table jobit4 drop columns(name); Error in query: mismatched input 'columns' expecting \{'PARTITION', 'IF'}(line 1, pos 25) == SQL == alter table jobit4 drop columns(name) -------------------------^^^ spark-sql> alter table jobit4 drop columns name; Error in query: mismatched input 'columns' expecting \{'PARTITION', 'IF'}(line 1, pos 25) == SQL == alter table jobit4 drop columns name -------------------------^^^ spark-sql> [