GitHub user andrewor14 opened a pull request:
https://github.com/apache/spark/pull/13457
[SPARK-15722][SQL] Disallow specifying schema in CTAS statement
## What changes were proposed in this pull request?
This is no longer allowed:
```
sql("CREATE TABLE blocks (name STRING, age INT) AS SELECT * FROM boxes")
```
This previously loaded data into the wrong columns if the schemas of
`blocks` and `boxes` don't match. We should just always use whatever columns
are projected as the schema.
## How was this patch tested?
HiveDDLCommandSuite
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/andrewor14/spark ctas-no-column
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13457.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #13457
----
commit 1ce7fdcaa059536b2b467bdbf5219a50e2535400
Author: Andrew Or <[email protected]>
Date: 2016-06-02T01:04:14Z
Ban CTAS with schema
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]