diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java index 5716cfa062..f34afb5e9b 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java @@ -630,7 +630,7 @@ public DirListingMetadata listChildren(final Path path) throws IOException { LOG.trace("Listing table {} in region {} for {} returning {}", tableName, region, path, metas); - return (metas.isEmpty() && dirPathMeta == null) + return (metas.isEmpty() || dirPathMeta == null) ? null : new DirListingMetadata(path, metas, isAuthoritative, dirPathMeta.getLastUpdated());