GitHub user brkyvz opened a pull request:

    https://github.com/apache/spark/pull/15896

    [SPARK-18465] Uncache table shouldn't throw an exception when table doesn't 
exist

    ## What changes were proposed in this pull request?
    
    While this behavior is debatable, consider the following use case:
    ```sql
    UNCACHE TABLE foo;
    CACHE TABLE foo AS 
    SELECT * FROM bar
    ```
    The command above fails the first time you run it. But I want to run the 
command above over and over again, and I don't want to change my code just for 
the first run of it.
    The issue is that subsequent `CACHE TABLE` commands do not overwrite the 
existing table.
    There are alternate solutions, e.g.
    1. `UNCACHE TABLE IF EXISTS foo`
    2. `CACHE AND REPLACE TABLE foo`
    Which will require additional work with the parser.
    
    I'm open to suggestions.
    
    ## How was this patch tested?
    
    Unit tests

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/brkyvz/spark uncache

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/15896.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 #15896
    
----
commit b8a479155c75022c1a4a2aad7bfdc4e5b0bc97bb
Author: Burak Yavuz <[email protected]>
Date:   2016-11-16T02:08:40Z

    Added test

----


---
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]

Reply via email to