[HUDI-3635] Fix HoodieMetadataTableValidator around comparison of partition path listing (#5100)
Co-authored-by: yuezhang <yuezhang@freewheel.tv>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package org.apache.hudi.common.model;
|
||||
|
||||
import org.apache.hudi.common.util.Option;
|
||||
import org.apache.hudi.exception.HoodieException;
|
||||
|
||||
import org.apache.hadoop.fs.FSDataInputStream;
|
||||
@@ -135,6 +136,23 @@ public class HoodiePartitionMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read out the COMMIT_TIME_KEY metadata for this partition.
|
||||
*/
|
||||
public Option<String> readPartitionCreatedCommitTime() {
|
||||
try {
|
||||
if (props.containsKey(COMMIT_TIME_KEY)) {
|
||||
return Option.of(props.getProperty(COMMIT_TIME_KEY));
|
||||
} else {
|
||||
readFromFS();
|
||||
return Option.of(props.getProperty(COMMIT_TIME_KEY));
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
LOG.warn("Error fetch Hoodie partition metadata for " + partitionPath, ioe);
|
||||
return Option.empty();
|
||||
}
|
||||
}
|
||||
|
||||
// methods related to partition meta data
|
||||
public static boolean hasPartitionMetadata(FileSystem fs, Path partitionPath) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user