Operation not allowed: alter table add columns(lin

2019-03-02 17:51发布

We have Spark 2.1, Thrift JDBC/ODBC server configured with Hive 2.1.1 and using Beeline.

DDL statements like

CREATE TABLE, CREATE TABLE LIKE, CREATE TABLE LIKE, ALTER TABLE SET TBLPROPERTIES

works well.

But ALTER TABLE ADD COLUMNS fails

create table tbl1 (id int, c1 string, c2 string);
alter table tbl1 add columns (c3 string);

Error: org.apache.spark.sql.catalyst.parser.ParseException: Operation not allowed: alter table add columns(line 1, pos 0)

== SQL == alter table tbl1 add columns (c3 string) ^^^ (state=,code=0)

Any hint would be appreciated

2条回答
爷、活的狠高调
2楼-- · 2019-03-02 18:03

Looks like this is work in progress for Spark v2.x

https://issues.apache.org/jira/browse/SPARK-19261

查看更多
Viruses.
3楼-- · 2019-03-02 18:19

Try using HiveContext instead of spark Session. As some of the hive metastore queries does on work well with spark Session.

查看更多
登录 后发表回答