diff --git a/hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java b/hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java index 0b94bbc898d6f..e874244db3684 100644 --- a/hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java +++ b/hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java @@ -186,7 +186,7 @@ protected List getAllQueryPartitionPaths() { // Load all the partition path from the basePath, and filter by the query partition path. // TODO load files from the queryRelativePartitionPaths directly. - List matchedPartitionPaths = getAllPartitionPathsUnchecked() + List matchedPartitionPaths = FSUtils.getAllPartitionPaths(engineContext, metadataConfig, basePath.toString()) .stream() .filter(path -> queryRelativePartitionPaths.stream().anyMatch(path::startsWith)) .collect(Collectors.toList()); @@ -331,14 +331,6 @@ private Map getAllFilesInPartitionsUnchecked(Collection getAllPartitionPathsUnchecked() { - try { - return isPartitionedTable() ? tableMetadata.getAllPartitionPaths() : Collections.singletonList(""); - } catch (IOException e) { - throw new HoodieIOException("Failed to fetch partition paths for a table", e); - } - } - private void validate(HoodieTimeline activeTimeline, Option queryInstant) { if (shouldValidateInstant) { if (queryInstant.isPresent() && !activeTimeline.containsInstant(queryInstant.get())) { @@ -366,10 +358,6 @@ private void resetTableMetadata(HoodieTableMetadata newTableMetadata) { tableMetadata = newTableMetadata; } - private boolean isPartitionedTable() { - return partitionColumns.length > 0 || HoodieTableMetadata.isMetadataTable(basePath.toString()); - } - public static final class PartitionPath { final String path;