XuQianJin-Stars commented on code in PR #5564:
URL: https://github.com/apache/hudi/pull/5564#discussion_r873305945


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/command/DropHoodieTableCommand.scala:
##########
@@ -69,13 +67,13 @@ extends HoodieLeafRunnableCommand {
     val catalog = sparkSession.sessionState.catalog
 
     // Drop table in the catalog
-    val enableHive = isEnableHive(sparkSession)
-    if (enableHive) {
-      dropHiveDataSourceTable(sparkSession, hoodieCatalogTable)
+    if (HoodieTableType.MERGE_ON_READ == hoodieCatalogTable.tableType && 
purge) {
+      val (rtTableOpt, roTableOpt) = getTableRTAndRO(catalog, 
hoodieCatalogTable)
+      rtTableOpt.foreach(table => catalog.dropTable(table.identifier, true, 
false))
+      roTableOpt.foreach(table => catalog.dropTable(table.identifier, true, 
false))
+      catalog.dropTable(table.identifier.copy(table = 
hoodieCatalogTable.tableName), ifExists, purge)
     } else {
-      if (catalog.tableExists(tableIdentifier)) {
-        catalog.dropTable(tableIdentifier, ifExists, purge)
-      }
+      catalog.dropTable(table.identifier, ifExists, purge)

Review Comment:
   `purge` is false  and `HoodieTableType.MERGE_ON_READ == 
hoodieCatalogTable.tableType` Don't need to drop `ro` and `rt` table? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to