You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/03/29 08:12:03 UTC

[GitHub] [hudi] XuQianJin-Stars commented on a change in pull request #5145: [HUDI-2520] Fix CTAS statment issue when sync to hive

XuQianJin-Stars commented on a change in pull request #5145:
URL: https://github.com/apache/hudi/pull/5145#discussion_r837182121



##########
File path: hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/command/CreateHoodieTableCommand.scala
##########
@@ -167,10 +166,6 @@ object CreateHoodieTableCommand {
     if (!dbExists) {
       throw new NoSuchDatabaseException(dbName)
     }
-    // check table exists
-    if (sparkSession.sessionState.catalog.tableExists(table.identifier)) {
-      throw new TableAlreadyExistsException(dbName, table.identifier.table)
-    }

Review comment:
       > this is some behavior change: can you clarify why this is a reasonable change? above this line, we check if db exists and throw, why we don't check for table?
   
   Because the call to AtomicCreateTableAsSelectExec will execute stageCreate and the table already exists.
   <img width="821" alt="企业微信截图_8ba54b75-e42d-4391-8b61-f409b43449bc" src="https://user-images.githubusercontent.com/10494131/160564423-e3febd28-9be6-4ca6-a45e-1e9f024b9189.png">
   <img width="1066" alt="企业微信截图_92d63278-4106-44ae-b831-a938afa18404" src="https://user-images.githubusercontent.com/10494131/160564499-e06721fe-9e81-407a-8423-e88cd86bd87d.png">
   
   




-- 
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: commits-unsubscribe@hudi.apache.org

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