Skip to content

Commit

Permalink
Fixing hudi related issue :
Browse files Browse the repository at this point in the history
1. exception handling in splitLoader
2. non-recursive iteration on hudi metadata dir
  • Loading branch information
ryadav-uptycs committed Dec 25, 2023
1 parent f95786d commit 5f2e34b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,29 @@ public LocalFileIterator(Location location, Path rootPath, Path path, boolean is
this.iterator = emptyIterator();
}
else {
try (Stream<Path> stream = (isRecursive ? Files.walk(path) : Files.list(path))) {
this.iterator = stream
.filter(Files::isRegularFile)
// materialize full list so stream can be closed
.collect(toImmutableList())
.iterator();
if (isRecursive) {
try (Stream<Path> stream = Files.walk(path)) {
this.iterator = stream
.filter(Files::isRegularFile)
// materialize full list so stream can be closed
.collect(toImmutableList())
.iterator();
}
catch (IOException e) {
throw handleException(location, e);
}
}
catch (IOException e) {
throw handleException(location, e);
else {
try (Stream<Path> stream = Files.list(path)) {
this.iterator = stream
.filter(Files::isRegularFile)
// materialize full list so stream can be closed
.collect(toImmutableList())
.iterator();
}
catch (IOException e) {
throw handleException(location, e);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.apache.avro.specific.SpecificRecordBase;

import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
Expand Down

0 comments on commit 5f2e34b

Please sign in to comment.