You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by windpiger <gi...@git.apache.org> on 2017/03/18 14:37:17 UTC

[GitHub] spark pull request #17341: [SPARK-20013][SQL]add a newTablePath parameter fo...

GitHub user windpiger opened a pull request:

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

    [SPARK-20013][SQL]add a newTablePath parameter for renameTable in ExternalCatalog

    ## What changes were proposed in this pull request?
    
    Currently when we create / rename a managed table, we should get the defaultTablePath for them in ExternalCatalog, then we have two defaultTablePath logic in its two subclass HiveExternalCatalog and InMemoryCatalog, additionally there is also a defaultTablePath in SessionCatalog, so till now we have three defaultTablePath in three classes. 
    we'd better to unify them up to SessionCatalog
    
    To unify them, we should move some logic from ExternalCatalog to SessionCatalog, renameTable is one of this.
    
    while limit to the simple parameters in renameTable 
    ```
      def renameTable(db: String, oldName: String, newName: String): Unit
    ```
    even if we move the defaultTablePath logic to SessionCatalog, we can not pass it to renameTable.
    
    So we can add a newTablePath parameter  for renameTable in ExternalCatalog 
    ## How was this patch tested?
    delete some tests in ExternalCatalogSuite which already existed in SessionCatalogSuite,
    and move some other tests  in ExternalCatalogSuite which does not exist in SessionCatalogSuite

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

    $ git pull https://github.com/windpiger/spark modifyRenameTable

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

    https://github.com/apache/spark/pull/17341.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 #17341
    
----
commit 80110e5783ab38d18e40ced06c3d926e6017b03f
Author: windpiger <so...@outlook.com>
Date:   2017-03-18T14:33:49Z

    [SPARK-20013][SQL]add a newTablePath parameter for renameTable in ExternalCatalog

----


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

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


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

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


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

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


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

    https://github.com/apache/spark/pull/17341
  
    Merged build finished. Test FAILed.


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

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


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

    https://github.com/apache/spark/pull/17341
  
    **[Test build #74784 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74784/testReport)** for PR 17341 at commit [`a2615b7`](https://github.com/apache/spark/commit/a2615b758a5b8dc5b20e4195fa1d4ba0cf099160).
     * This patch **fails Scala style tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

    https://github.com/apache/spark/pull/17341
  
    We are closing it due to inactivity. please do reopen if you want to push it forward. Thanks!


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

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


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

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


[GitHub] spark pull request #17341: [SPARK-20013][SQL]add a newTablePath parameter fo...

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

    https://github.com/apache/spark/pull/17341#discussion_r106782178
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala ---
    @@ -196,30 +196,6 @@ abstract class ExternalCatalogSuite extends SparkFunSuite with BeforeAndAfterEac
         catalog.dropTable("db2", "unknown_table", ignoreIfNotExists = true, purge = false)
       }
     
    -  test("rename table") {
    -    val catalog = newBasicCatalog()
    -    assert(catalog.listTables("db2").toSet == Set("tbl1", "tbl2"))
    -    catalog.renameTable("db2", "tbl1", "tblone")
    -    assert(catalog.listTables("db2").toSet == Set("tblone", "tbl2"))
    -  }
    -
    -  test("rename table when database/table does not exist") {
    --- End diff --
    
    already existed in [SessionCatalogSuite](https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala#L393)


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

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


[GitHub] spark pull request #17341: [SPARK-20013][SQL]add a newTablePath parameter fo...

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

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


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

    https://github.com/apache/spark/pull/17341
  
    **[Test build #74785 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74785/testReport)** for PR 17341 at commit [`857c4c2`](https://github.com/apache/spark/commit/857c4c217e57ed279a4e4542cbe4d39e232fa043).


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

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


[GitHub] spark pull request #17341: [SPARK-20013][SQL]add a newTablePath parameter fo...

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

    https://github.com/apache/spark/pull/17341#discussion_r106782161
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala ---
    @@ -196,30 +196,6 @@ abstract class ExternalCatalogSuite extends SparkFunSuite with BeforeAndAfterEac
         catalog.dropTable("db2", "unknown_table", ignoreIfNotExists = true, purge = false)
       }
     
    -  test("rename table") {
    --- End diff --
    
    already existed in [SessionCatalogSuite](https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala#L361)


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

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


[GitHub] spark pull request #17341: [SPARK-20013][SQL]add a newTablePath parameter fo...

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

    https://github.com/apache/spark/pull/17341#discussion_r106782193
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala ---
    @@ -732,40 +696,6 @@ abstract class ExternalCatalogSuite extends SparkFunSuite with BeforeAndAfterEac
         assert(!exists(db.locationUri))
       }
     
    -  test("create/drop/rename table should create/delete/rename the directory") {
    --- End diff --
    
    move to `SessionCatalogSuite`


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

    https://github.com/apache/spark/pull/17341
  
    Maybe we can close this one at first and revisit it later?


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

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


[GitHub] spark issue #17341: [SPARK-20013][SQL]add a newTablePath parameter for renam...

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

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


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

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


[GitHub] spark pull request #17341: [SPARK-20013][SQL]add a newTablePath parameter fo...

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

    https://github.com/apache/spark/pull/17341#discussion_r106782179
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala ---
    @@ -196,30 +196,6 @@ abstract class ExternalCatalogSuite extends SparkFunSuite with BeforeAndAfterEac
         catalog.dropTable("db2", "unknown_table", ignoreIfNotExists = true, purge = false)
       }
     
    -  test("rename table") {
    -    val catalog = newBasicCatalog()
    -    assert(catalog.listTables("db2").toSet == Set("tbl1", "tbl2"))
    -    catalog.renameTable("db2", "tbl1", "tblone")
    -    assert(catalog.listTables("db2").toSet == Set("tblone", "tbl2"))
    -  }
    -
    -  test("rename table when database/table does not exist") {
    -    val catalog = newBasicCatalog()
    -    intercept[AnalysisException] {
    -      catalog.renameTable("unknown_db", "unknown_table", "unknown_table")
    -    }
    -    intercept[AnalysisException] {
    -      catalog.renameTable("db2", "unknown_table", "unknown_table")
    -    }
    -  }
    -
    -  test("rename table when destination table already exists") {
    --- End diff --
    
    move to `SessionCatalogSuite`


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

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