Skip to content

Commit f8ecd56

Browse files
committed
add try with to close fs
1 parent 95a6334 commit f8ecd56

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/main/java/io/delta/sharing/java/DeltaSharing.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ private List<Path> getCheckpointPaths(List<AddFile> files) {
217217
@SuppressWarnings("UnnecessaryLocalVariable")
218218
public TableReader<GenericRecord> getTableReader(Table table) throws IOException, URISyntaxException {
219219
List<AddFile> files = getFiles(table, new LinkedList<>());
220-
DeltaSharingFileSystem fs = new DeltaSharingFileSystem();
221-
fs.setConf(new Configuration());
220+
try (DeltaSharingFileSystem fs = new DeltaSharingFileSystem()) {
221+
fs.setConf(new Configuration());
222+
}
222223
String uniqueRef = getCoordinates(table);
223224
List<Path> paths;
224225
DeltaTableMetadata newMetadata = this.getMetadata(table);

0 commit comments

Comments
 (0)