diff options
author | Dilip Biswal <dbiswal@us.ibm.com> | 2016-11-22 15:57:07 -0800 |
---|---|---|
committer | gatorsmile <gatorsmile@gmail.com> | 2016-11-22 15:57:07 -0800 |
commit | 39a1d30636857715247c82d551b200e1c331ad69 (patch) | |
tree | 1ccc38bdcd0ff7c337da88ba5120b6693198ca49 /R/pkg/inst | |
parent | 9c42d4a76ca8046fcca2e20067f2aa461977e65a (diff) | |
download | spark-39a1d30636857715247c82d551b200e1c331ad69.tar.gz spark-39a1d30636857715247c82d551b200e1c331ad69.tar.bz2 spark-39a1d30636857715247c82d551b200e1c331ad69.zip |
[SPARK-18533] Raise correct error upon specification of schema for datasource tables created using CTAS
## What changes were proposed in this pull request?
Fixes the inconsistency of error raised between data source and hive serde
tables when schema is specified in CTAS scenario. In the process the grammar for
create table (datasource) is simplified.
**before:**
``` SQL
spark-sql> create table t2 (c1 int, c2 int) using parquet as select * from t1;
Error in query:
mismatched input 'as' expecting {<EOF>, '.', 'OPTIONS', 'CLUSTERED', 'PARTITIONED'}(line 1, pos 64)
== SQL ==
create table t2 (c1 int, c2 int) using parquet as select * from t1
----------------------------------------------------------------^^^
```
**After:**
```SQL
spark-sql> create table t2 (c1 int, c2 int) using parquet as select * from t1
> ;
Error in query:
Operation not allowed: Schema may not be specified in a Create Table As Select (CTAS) statement(line 1, pos 0)
== SQL ==
create table t2 (c1 int, c2 int) using parquet as select * from t1
^^^
```
## How was this patch tested?
Added a new test in CreateTableAsSelectSuite
Author: Dilip Biswal <dbiswal@us.ibm.com>
Closes #15968 from dilipbiswal/ctas.
Diffstat (limited to 'R/pkg/inst')
0 files changed, 0 insertions, 0 deletions