You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2017/10/01 03:24:21 UTC

[GitHub] spark pull request #19405: [SPARK-22178] [SQL] Refresh Persistent Views by R...

GitHub user gatorsmile opened a pull request:

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

    [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH TABLE Command

    ## What changes were proposed in this pull request?
    The underlying tables of persistent views are not refreshed when users issue the REFRESH TABLE command against the persistent views.
    
    ## How was this patch tested?
    Added a test case

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

    $ git pull https://github.com/gatorsmile/spark refreshView

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

    https://github.com/apache/spark/pull/19405.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 #19405
    
----
commit 6650fcf4ab313c4fb3c48560fd575327b8162845
Author: gatorsmile <ga...@gmail.com>
Date:   2017-10-01T03:13:40Z

    fix

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/82425/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    **[Test build #82425 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/82425/testReport)** for PR 19405 at commit [`d677c77`](https://github.com/apache/spark/commit/d677c779488dc989bca2f1e3aefb94152227ddf9).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    **[Test build #82365 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/82365/testReport)** for PR 19405 at commit [`6650fcf`](https://github.com/apache/spark/commit/6650fcf4ab313c4fb3c48560fd575327b8162845).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    cc @cloud-fan 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #19405: [SPARK-22178] [SQL] Refresh Persistent Views by R...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/82365/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by viirya <gi...@git.apache.org>.
Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    LGTM except for one minor comment.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    **[Test build #82365 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/82365/testReport)** for PR 19405 at commit [`6650fcf`](https://github.com/apache/spark/commit/6650fcf4ab313c4fb3c48560fd575327b8162845).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #19405: [SPARK-22178] [SQL] Refresh Persistent Views by R...

Posted by jiangxb1987 <gi...@git.apache.org>.
Github user jiangxb1987 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19405#discussion_r142310673
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetadataCacheSuite.scala ---
    @@ -31,14 +31,22 @@ import org.apache.spark.sql.test.SQLTestUtils
     class HiveMetadataCacheSuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
     
       test("SPARK-16337 temporary view refresh") {
    -    withTempView("view_refresh") {
    +    checkRefreshView(isTemp = true)
    +  }
    +
    +  test("view refresh") {
    --- End diff --
    
    We didn't cover the persistent view case for refresh, that's why the bug happens...


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #19405: [SPARK-22178] [SQL] Refresh Persistent Views by R...

Posted by viirya <gi...@git.apache.org>.
Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19405#discussion_r142059110
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala ---
    @@ -474,13 +474,20 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
        */
       override def refreshTable(tableName: String): Unit = {
         val tableIdent = sparkSession.sessionState.sqlParser.parseTableIdentifier(tableName)
    -    // Temp tables: refresh (or invalidate) any metadata/data cached in the plan recursively.
    -    // Non-temp tables: refresh the metadata cache.
    -    sessionCatalog.refreshTable(tableIdent)
    -
    +    val tableMetadata = sessionCatalog.getTempViewOrPermanentTableMetadata(tableIdent)
         // If this table is cached as an InMemoryRelation, drop the original
    --- End diff --
    
    This comment should be moved to line 491.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #19405: [SPARK-22178] [SQL] Refresh Persistent Views by R...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19405#discussion_r142450897
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetadataCacheSuite.scala ---
    @@ -31,14 +31,22 @@ import org.apache.spark.sql.test.SQLTestUtils
     class HiveMetadataCacheSuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
     
       test("SPARK-16337 temporary view refresh") {
    -    withTempView("view_refresh") {
    +    checkRefreshView(isTemp = true)
    +  }
    +
    +  test("view refresh") {
    --- End diff --
    
    Yes. We need to ask contributors for adding more test cases when reviewing the PR. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    Thanks! Merged to master/2.2


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #19405: [SPARK-22178] [SQL] Refresh Persistent Views by REFRESH ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19405
  
    **[Test build #82425 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/82425/testReport)** for PR 19405 at commit [`d677c77`](https://github.com/apache/spark/commit/d677c779488dc989bca2f1e3aefb94152227ddf9).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org