-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-16229] [SQL] Drop Empty Table After CREATE TABLE AS SELECT fails #13926
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
|
Look pretty good. Are there any other places where this can happen? |
|
Thanks! @hvanhovell After going over the other functions that called |
|
Test build #61312 has finished for PR 13926 at commit
|
|
|
|
ping @hvanhovell Could you please take a look at this again? : ) |
|
retest this please |
|
Test build #61527 has finished for PR 13926 at commit
|
|
retest this please |
|
Test build #61732 has finished for PR 13926 at commit
|
|
@hvanhovell @cloud-fan @liancheng Any comment about this PR? |
|
does CreateDataSourceTableAsSelectCommand has this problem? |
|
@cloud-fan |
|
Is it possible we also use this order in |
|
LGTM |
|
@cloud-fan Probably not? |
#### What changes were proposed in this pull request? In `CREATE TABLE AS SELECT`, if the `SELECT` query failed, the table should not exist. For example, ```SQL CREATE TABLE tab STORED AS TEXTFILE SELECT 1 AS a, (SELECT a FROM (SELECT 1 AS a UNION ALL SELECT 2 AS a) t) AS b ``` The above query failed as expected but an empty table `t` is created. This PR is to drop the created table when hitting any non-fatal exception. #### How was this patch tested? Added a test case to verify the behavior Author: gatorsmile <gatorsmile@gmail.com> Closes #13926 from gatorsmile/dropTableAfterException. (cherry picked from commit 21eadd1) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
|
thanks, merging to master and 2.0! |
|
Thanks! @cloud-fan @liancheng @hvanhovell |
What changes were proposed in this pull request?
In
CREATE TABLE AS SELECT, if theSELECTquery failed, the table should not exist. For example,The above query failed as expected but an empty table
tis created.This PR is to drop the created table when hitting any non-fatal exception.
How was this patch tested?
Added a test case to verify the behavior