SteNicholas commented on code in PR #7940:
URL: https://github.com/apache/hudi/pull/7940#discussion_r1106161385


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieHiveCatalog.java:
##########
@@ -656,12 +657,10 @@ public void dropTable(ObjectPath tablePath, boolean 
ignoreIfNotExists)
       client.dropTable(
           tablePath.getDatabaseName(),
           tablePath.getObjectName(),
-          // Indicate whether associated data should be deleted.
-          // Set to 'true' for now because Flink tables shouldn't have data in 
Hive. Can
-          // be changed later if necessary
-          true,
+          // External table drops only the metadata, should not delete the 
underlying data.
+          
!TableType.EXTERNAL_TABLE.name().equals(getHiveTable(tablePath).getTableType().toUpperCase(Locale.ROOT)),

Review Comment:
   @Leoyzen, the `HiveMetaStore` of Hive 2.3 and 3.x doesn't delete data when 
table type is `EXTERNAL_TABLE` for 
[L1715](https://github.com/apache/hive/blob/branch-2.3/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java#L1715)
   
[L2482](https://github.com/apache/hive/blob/branch-3.0/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java#L2482).
 This doesn't need to change for `EXTERNAL_TABLE`, therefore I have reverted 
this change.



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