boneanxs commented on code in PR #8452: URL: https://github.com/apache/hudi/pull/8452#discussion_r1199888295
########## hudi-common/src/main/java/org/apache/hudi/metadata/FileSystemBackedTableMetadata.java: ########## @@ -121,14 +184,24 @@ private List<String> getPartitionPathWithPathPrefix(String relativePathPrefix) t List<Pair<Option<String>, Option<Path>>> result = engineContext.map(dirToFileListing, fileStatus -> { FileSystem fileSystem = fileStatus.getPath().getFileSystem(hadoopConf.get()); if (fileStatus.isDirectory()) { + String relativePartitionPath = FSUtils.getRelativePartitionPath(new Path(datasetBasePath), fileStatus.getPath()); if (HoodiePartitionMetadata.hasPartitionMetadata(fileSystem, fileStatus.getPath())) { - return Pair.of(Option.of(FSUtils.getRelativePartitionPath(new Path(datasetBasePath), fileStatus.getPath())), Option.empty()); + if (boundedExpr instanceof Predicates.TrueExpression || (Boolean) boundedExpr.eval(HoodieTableMetadata + .extractPartitionValues(partitionFields, relativePartitionPath, hiveStylePartitioningEnabled, urlEncodePartitioningEnabled))) { + return Pair.of(Option.of(relativePartitionPath), Option.empty()); + } } else if (!fileStatus.getPath().getName().equals(HoodieTableMetaClient.METAFOLDER_NAME)) { - return Pair.of(Option.empty(), Option.of(fileStatus.getPath())); + if (boundedExpr instanceof Predicates.TrueExpression || (Boolean) boundedExpr.eval(HoodieTableMetadata + .extractPartitionValues(partitionFields, relativePartitionPath, hiveStylePartitioningEnabled, urlEncodePartitioningEnabled))) { + return Pair.of(Option.empty(), Option.of(fileStatus.getPath())); + } } } else if (fileStatus.getPath().getName().startsWith(HoodiePartitionMetadata.HOODIE_PARTITION_METAFILE_PREFIX)) { Review Comment: Yes, I think this is needed for non-partitioned datasets. -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org