-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-16457] [SQL] Fix Wrong Messages when CTAS with a Partition By Clause #14113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a dead code if we do not change the order.
|
Test build #62013 has finished for PR 14113 at commit
|
|
retest this please |
|
Test build #62026 has finished for PR 14113 at commit
|
|
wrong branch... Let me revert it back |
|
Test build #62046 has finished for PR 14113 at commit
|
|
Test build #62045 has finished for PR 14113 at commit
|
|
retest this please |
|
Test build #62181 has finished for PR 14113 at commit
|
|
cc @cloud-fan |
|
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? |
|
Test build #63237 has finished for PR 14113 at commit
|
|
can you update it? thanks! |
|
Will update it tonight. Thanks! |
|
LGTM, pending jenkins |
|
Test build #63343 has finished for PR 14113 at commit
|
|
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 <[email protected]> Closes #14113 from gatorsmile/ctas. (cherry picked from commit ab12690) Signed-off-by: Wenchen Fan <[email protected]>
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.