tengqm commented on code in PR #6488: URL: https://github.com/apache/gravitino/pull/6488#discussion_r1962562404
########## catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java: ########## @@ -257,11 +257,10 @@ public Fileset createFileset( ? new Path(storageLocation) : new Path(schemaPath, ident.name()); - try { + try (FileSystem fs = getFileSystem(filesetPath, conf)) { // formalize the path to avoid path without scheme, uri, authority, etc. filesetPath = formalizePath(filesetPath, conf); Review Comment: should we move this line before the try block? ########## catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java: ########## @@ -716,8 +733,9 @@ private Path getSchemaPath(String name, Map<String, String> properties) { @VisibleForTesting Path formalizePath(Path path, Map<String, String> configuration) throws IOException { - FileSystem defaultFs = getFileSystem(path, configuration); - return path.makeQualified(defaultFs.getUri(), defaultFs.getWorkingDirectory()); + try (FileSystem defaultFs = getFileSystem(path, configuration)) { + return path.makeQualified(defaultFs.getUri(), defaultFs.getWorkingDirectory()); + } Review Comment: Why wrap this into a try block? -- 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...@gravitino.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org