Skip to content
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

[SPARK-18517][SQL] DROP TABLE IF EXISTS should not warn for non-existing tables #15953

Closed
wants to merge 1 commit into from
Closed

Conversation

dongjoon-hyun
Copy link
Member

What changes were proposed in this pull request?

Currently, DROP TABLE IF EXISTS shows warning for non-existing tables. However, it had better be quiet for this case by definition of the command.

BEFORE

scala> sql("DROP TABLE IF EXISTS nonexist")
16/11/20 20:48:26 WARN DropTableCommand: org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'nonexist' not found in database 'default';

AFTER

scala> sql("DROP TABLE IF EXISTS nonexist")
res0: org.apache.spark.sql.DataFrame = []

How was this patch tested?

Manual because this is related to the warning messages instead of exceptions.

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented Nov 21, 2016

Hi, @gatorsmile .
This is a related case with #15682 (Dropping View) and the uncache issue.
But, this case is different from the above cases because this PR has the obvious solution.
How do you think about this bug and PR?

@SparkQA
Copy link

SparkQA commented Nov 21, 2016

Test build #68914 has finished for PR 15953 at commit 95a8a32.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@andrewor14
Copy link
Contributor

andrewor14 commented Nov 21, 2016

Makes sense. This LGTM merging into master and 2.1. Thanks.

asfgit pushed a commit that referenced this pull request Nov 21, 2016
…ing tables

## What changes were proposed in this pull request?

Currently, `DROP TABLE IF EXISTS` shows warning for non-existing tables. However, it had better be quiet for this case by definition of the command.

**BEFORE**
```scala
scala> sql("DROP TABLE IF EXISTS nonexist")
16/11/20 20:48:26 WARN DropTableCommand: org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'nonexist' not found in database 'default';
```

**AFTER**
```scala
scala> sql("DROP TABLE IF EXISTS nonexist")
res0: org.apache.spark.sql.DataFrame = []
```

## How was this patch tested?

Manual because this is related to the warning messages instead of exceptions.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes #15953 from dongjoon-hyun/SPARK-18517.

(cherry picked from commit ddd02f5)
Signed-off-by: Andrew Or <andrewor14@gmail.com>
@dongjoon-hyun
Copy link
Member Author

Thank you so much, @andrewor14 ! :)

@asfgit asfgit closed this in ddd02f5 Nov 21, 2016
@dongjoon-hyun dongjoon-hyun deleted the SPARK-18517 branch November 22, 2016 00:55
robert3005 pushed a commit to palantir/spark that referenced this pull request Dec 2, 2016
…ing tables

## What changes were proposed in this pull request?

Currently, `DROP TABLE IF EXISTS` shows warning for non-existing tables. However, it had better be quiet for this case by definition of the command.

**BEFORE**
```scala
scala> sql("DROP TABLE IF EXISTS nonexist")
16/11/20 20:48:26 WARN DropTableCommand: org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'nonexist' not found in database 'default';
```

**AFTER**
```scala
scala> sql("DROP TABLE IF EXISTS nonexist")
res0: org.apache.spark.sql.DataFrame = []
```

## How was this patch tested?

Manual because this is related to the warning messages instead of exceptions.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes apache#15953 from dongjoon-hyun/SPARK-18517.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…ing tables

## What changes were proposed in this pull request?

Currently, `DROP TABLE IF EXISTS` shows warning for non-existing tables. However, it had better be quiet for this case by definition of the command.

**BEFORE**
```scala
scala> sql("DROP TABLE IF EXISTS nonexist")
16/11/20 20:48:26 WARN DropTableCommand: org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'nonexist' not found in database 'default';
```

**AFTER**
```scala
scala> sql("DROP TABLE IF EXISTS nonexist")
res0: org.apache.spark.sql.DataFrame = []
```

## How was this patch tested?

Manual because this is related to the warning messages instead of exceptions.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes apache#15953 from dongjoon-hyun/SPARK-18517.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants