zhangyue19921010 commented on a change in pull request #5217:
URL: https://github.com/apache/hudi/pull/5217#discussion_r841173234
##########
File path:
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieTableMetadataUtil.java
##########
@@ -210,12 +212,15 @@
* @param context instance of {@link HoodieEngineContext}.
*/
public static void deleteMetadataTable(String basePath, HoodieEngineContext
context) {
- final String metadataTablePath =
HoodieTableMetadata.getMetadataTableBasePath(basePath);
- FileSystem fs = FSUtils.getFs(metadataTablePath,
context.getHadoopConf().get());
+ final String metadataTablePathStr =
HoodieTableMetadata.getMetadataTableBasePath(basePath);
+ FileSystem fs = FSUtils.getFs(metadataTablePathStr,
context.getHadoopConf().get());
try {
- fs.delete(new Path(metadataTablePath), true);
+ Path metadataTablePath = new Path(metadataTablePathStr);
+ if (fs.exists(metadataTablePath)) {
+ fs.delete(metadataTablePath, true);
Review comment:
nit: do we need to add a log info here, logging when and where we
deleted the whole MDT.
--
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]