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 2022/06/20 06:32:59 UTC

[GitHub] [spark] AngersZhuuuu opened a new pull request, #36919: [SPARK-39572][SQL] RenameTable should check newTable's identifier

AngersZhuuuu opened a new pull request, #36919:
URL: https://github.com/apache/spark/pull/36919

   ### What changes were proposed in this pull request?
   For a simple case of RenameTable
   ```
     test("rename a table") {
       sql("ALTER TABLE h2.test.empty_table RENAME TO h2.test.empty_table2")
       checkAnswer(
         sql("SHOW TABLES IN h2.test"),
         Seq(Row("test", "empty_table2")))
     }
   ```
   
   It will throw exception as below
   ```
   [info] - rename a table *** FAILED *** (2 seconds, 358 milliseconds)
   [info]   org.apache.spark.sql.catalyst.analysis.NoSuchNamespaceException: Failed table renaming from test.empty_table to h2.test.empty_table2
   [info]   at org.apache.spark.sql.jdbc.H2Dialect$.classifyException(H2Dialect.scala:117)
   [info]   at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.classifyException(JdbcUtils.scala:1176)
   [info]   at org.apache.spark.sql.execution.datasources.v2.jdbc.JDBCTableCatalog.$anonfun$renameTable$1(JDBCTableCatalog.scala:102)
   [info]   at org.apache.spark.sql.execution.datasources.v2.jdbc.JDBCTableCatalog.$anonfun$renameTable$1$adapted(JDBCTableCatalog.scala:100)
   [info]   at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.withConnection(JdbcUtils.scala:1184)
   [info]   at org.apache.spark.sql.execution.datasources.v2.jdbc.JDBCTableCatalog.renameTable(JDBCTableCatalog.scala:100)
   [info]   at org.apache.spark.sql.execution.datasources.v2.RenameTableExec.run(RenameTableExec.scala:51)
   [info]   at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:43)
   [info]   at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:43)
   [info]   at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:49)
   [info]   at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:98)
   [info]   at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$6(SQLExecution.scala:111)
   [info]   at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:171)
   [info]   at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:95)
   [info]   at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:779)
   [info]   at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:64)
   
   ```
   
   From here we pass all identifiers to the backend catalog with catalog, it will failed the query.
   In this pr we do below things:
   
   1. Make sure that RENAME TABLE 's new table should bring catalog identifier too.
   2. Check catalog is same as old table ident
   
   
   ### Why are the changes needed?
   Fix bugs. RENAME TABLE 's newTable and oldTable in V2 should both bring catalog.
   
   
   ### Does this PR introduce _any_ user-facing change?
   When people want to use RENAME TABLE in v2, should bring catalog info for new ident too.
   
   ### How was this patch tested?
   Added UT
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] AngersZhuuuu commented on pull request #36919: [SPARK-39572][SQL] RenameTable should support same catalog name in newTable's identifier

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on PR #36919:
URL: https://github.com/apache/spark/pull/36919#issuecomment-1161768540

   ping @cloud-fan How about current?


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] github-actions[bot] closed pull request #36919: [SPARK-39527][SQL] RenameTable should support same catalog name in newTable's identifier

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #36919: [SPARK-39527][SQL] RenameTable should support same catalog name in  newTable's identifier
URL: https://github.com/apache/spark/pull/36919


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] github-actions[bot] commented on pull request #36919: [SPARK-39527][SQL] RenameTable should support same catalog name in newTable's identifier

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #36919:
URL: https://github.com/apache/spark/pull/36919#issuecomment-1272665852

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] AngersZhuuuu commented on pull request #36919: [SPARK-39527][SQL] RenameTable should support same catalog name in newTable's identifier

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on PR #36919:
URL: https://github.com/apache/spark/pull/36919#issuecomment-1171903236

   Any suggestion?
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] AngersZhuuuu commented on pull request #36919: [SPARK-39527][SQL] RenameTable should support same catalog name in newTable's identifier

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on PR #36919:
URL: https://github.com/apache/spark/pull/36919#issuecomment-1165325229

   gentle ping @dongjoon-hyun @HyukjinKwon @cloud-fan


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] AngersZhuuuu commented on pull request #36919: [SPARK-39572][SQL] RenameTable should check newTable's identifier

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on PR #36919:
URL: https://github.com/apache/spark/pull/36919#issuecomment-1160031193

   ping @cloud-fan 


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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