Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16457] [SQL] Fix Wrong Messages when CTAS with a Partition By Clause - #14113
[SPARK-16457] [SQL] Fix Wrong Messages when CTAS with a Partition By Clause#14113gatorsmile wants to merge 1 commit into
Conversation
| ctx) | ||
| } | ||
| // Hive does not allow to use a CTAS statement to create a partitioned table. | ||
| if (tableDesc.partitionColumnNames.nonEmpty) { |
There was a problem hiding this comment.
This is a dead code if we do not change the order.
SparkQA
commented
Jul 9, 2016
Test build #62013 has finished for PR 14113 at commit
|
gatorsmile
commented
Jul 9, 2016
retest this please |
SparkQA
commented
Jul 9, 2016
Test build #62026 has finished for PR 14113 at commit
|
gatorsmile
commented
Jul 10, 2016
wrong branch... Let me revert it back |
SparkQA
commented
Jul 10, 2016
Test build #62046 has finished for PR 14113 at commit
|
SparkQA
commented
Jul 10, 2016
Test build #62045 has finished for PR 14113 at commit
|
gatorsmile
commented
Jul 12, 2016
retest this please |
SparkQA
commented
Jul 12, 2016
Test build #62181 has finished for PR 14113 at commit
|
gatorsmile
commented
Jul 12, 2016
cc @cloud-fan |
gatorsmile
commented
Aug 4, 2016
retest this please |
cc @cloud-fan This is not contained in #14482. Should I leave it open? or you will merge it into the PR? |
SparkQA
commented
Aug 4, 2016
Test build #63237 has finished for PR 14113 at commit
|
cloud-fan
commented
Aug 8, 2016
can you update it? thanks! |
gatorsmile
commented
Aug 8, 2016
Will update it tonight. Thanks! |
cloud-fan
commented
Aug 8, 2016
LGTM, pending jenkins |
SparkQA
commented
Aug 8, 2016
Test build #63343 has finished for PR 14113 at commit
|
cloud-fan
commented
Aug 8, 2016
thanks, merging to master and 2.0! |
…lause #### What changes were proposed in this pull request? When doing a CTAS with a Partition By clause, we got a wrong error message. For example, ```SQL CREATE TABLE gen__tmp PARTITIONED BY (key string) AS SELECT key, value FROM mytable1 ``` The error message we get now is like ``` Operation not allowed: Schema may not be specified in a Create Table As Select (CTAS) statement(line 2, pos 0) ``` However, based on the code, the message we should get is like ``` Operation not allowed: A Create Table As Select (CTAS) statement is not allowed to create a partitioned table using Hive's file formats. Please use the syntax of "CREATE TABLE tableName USING dataSource OPTIONS (...) PARTITIONED BY ...\" to create a partitioned table through a CTAS statement.(line 2, pos 0) ``` Currently, partitioning columns is part of the schema. This PR fixes the bug by changing the detection orders. #### How was this patch tested? Added test cases. Author: gatorsmile <gatorsmile@gmail.com> Closes#14113 from gatorsmile/ctas. (cherry picked from commit ab12690) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
When doing a CTAS with a Partition By clause, we got a wrong error message.
For example,
The error message we get now is like
However, based on the code, the message we should get is like
Currently, partitioning columns is part of the schema. This PR fixes the bug by changing the detection orders.
How was this patch tested?
Added test cases.