Skip to content

Commit

Permalink
Let getAllDataFilesFromTableDirectory recurse directories
Browse files Browse the repository at this point in the history
  • Loading branch information
homar authored and findepi committed Jan 21, 2022
1 parent 8b47472 commit ffb6abb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.ImmutableMap.toImmutableMap;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.common.collect.Iterables.concat;
import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.MoreCollectors.onlyElement;
Expand Down Expand Up @@ -3327,8 +3328,9 @@ private List<String> getAllDataFilesFromTableDirectory(String tableName)
{
String schema = getSession().getSchema().orElseThrow();
Path tableDataDir = getDistributedQueryRunner().getCoordinator().getBaseDataDir().resolve("iceberg_data").resolve(schema).resolve(tableName).resolve("data");
try (Stream<Path> list = Files.list(tableDataDir)) {
return list
try (Stream<Path> walk = Files.walk(tableDataDir)) {
return walk
.filter(Files::isRegularFile)
.filter(path -> !path.getFileName().toString().matches("\\..*\\.crc"))
.map(Path::toString)
.collect(toImmutableList());
Expand Down

0 comments on commit ffb6abb

Please sign in to comment.