GitHub user liancheng opened a pull request:

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

    [SPARK-1669][SQL]  Made cacheTable idempotent

    JIRA issue: [SPARK-1669](https://issues.apache.org/jira/browse/SPARK-1669)
    
    Caching the same multiple times should end up with only 1 in-memory 
columnar representation of this table.
    
    Before:
    
    ```
    scala> loadTestTable("src")
    ...
    scala> cacheTable("src")
    ...
    scala> cacheTable("src")
    ...
    scala> table("src")
    ...
    == Query Plan ==
    InMemoryColumnarTableScan [key#2,value#3], (InMemoryRelation 
[key#2,value#3], false, (InMemoryColumnarTableScan [key#2,value#3], 
(InMemoryRelation [key#2,value#3], false, (HiveTableScan [key#2,value#3], 
(MetastoreRelation default, src, None), None))))
    ```
    
    After:
    
    ```
    scala> loadTestTable("src")
    ...
    scala> cacheTable("src")
    ...
    scala> cacheTable("src")
    ...
    scala> table("src")
    ...
    == Query Plan ==
    InMemoryColumnarTableScan [key#2,value#3], (InMemoryRelation 
[key#2,value#3], false, (HiveTableScan [key#2,value#3], (MetastoreRelation 
default, src, None), None))
    ```

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

    $ git pull https://github.com/liancheng/spark spark-1669

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

    https://github.com/apache/spark/pull/1183.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 #1183
    
----
commit 51bae90c74bb211bd9ecaa5bf2c5f3dc6c193249
Author: Cheng Lian <lian.cs....@gmail.com>
Date:   2014-06-23T17:48:59Z

    Made cacheTable idempotent

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to