You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/19 18:05:27 UTC

[GitHub] [spark] MaxGekk opened a new pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

MaxGekk opened a new pull request #31594:
URL: https://github.com/apache/spark/pull/31594


   ### What changes were proposed in this pull request?
   If new table name consists of single part (no namespaces), the v2 `ALTER TABLE .. RENAME TO` command renames the table while keeping it in the same namespace. For example:
   ```sql
   ALTER TABLE catalog_name.ns1.ns2.ns3.ns4.ns5.tbl RENAME TO new_table
   ```
   the command should rename the source table to `catalog_name.ns1.ns2.ns3.ns4.ns5.new_table`. Before the changes, the command moves the table to the "root" name space i.e. `catalog_name.new_table`.
   
   ### Why are the changes needed?
   To have the same behavior as v1 implementation of `ALTER TABLE .. RENAME TO`, and other DBMSs.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes
   
   ### How was this patch tested?
   By running new test:
   ```
   $ build/sbt "sql/test:testOnly *DataSourceV2SQLSuite"
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782431928


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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782351264


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/39855/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782437494


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135276/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-783075322


   thanks, merging to master!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan closed pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #31594:
URL: https://github.com/apache/spark/pull/31594


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782257865


   **[Test build #135276 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135276/testReport)** for PR 31594 at commit [`83af021`](https://github.com/apache/spark/commit/83af021c24f751b21bb0d718023eb2fdb859e209).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] MaxGekk commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782243274


   @cloud-fan @rdblue Could you review this PR, please.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan commented on a change in pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #31594:
URL: https://github.com/apache/spark/pull/31594#discussion_r579980038



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/RenameTableExec.scala
##########
@@ -43,12 +43,20 @@ case class RenameTableExec(
     val optOldStorageLevel = invalidateCache()
     catalog.invalidateTable(oldIdent)
 
-    catalog.renameTable(oldIdent, newIdent)
+    // If new identifier consists of a table name only, the table should be renamed in place.
+    // Such behavior matches to the v1 implementation of table renaming in Spark and other DBMSs.

Review comment:
       shall we do it in the analysis phase?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782282713


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39855/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA removed a comment on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782257865


   **[Test build #135276 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135276/testReport)** for PR 31594 at commit [`83af021`](https://github.com/apache/spark/commit/83af021c24f751b21bb0d718023eb2fdb859e209).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782351264


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/39855/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782437494


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135276/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31594: [SPARK-34468][SQL] Rename v2 table in place if new name has single part

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31594:
URL: https://github.com/apache/spark/pull/31594#issuecomment-782336621


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39855/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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