Skip to content

Commit

Permalink
[update][plugin][hdfsreader] use try-with-resources statement
Browse files Browse the repository at this point in the history
  • Loading branch information
wgzhao committed Oct 30, 2024
1 parent fbe2f40 commit 4be0d47
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ private static boolean isSequenceFile(Path filepath, FSDataInputStream in)

private static boolean isParquetFile(Path file)
{
try {
GroupReadSupport readSupport = new GroupReadSupport();
ParquetReader.Builder<Group> reader = ParquetReader.builder(readSupport, file);
ParquetReader<Group> build = reader.build();
GroupReadSupport readSupport = new GroupReadSupport();
ParquetReader.Builder<Group> reader = ParquetReader.builder(readSupport, file);
try (ParquetReader<Group> build = reader.build()) {
if (build.read() != null) {
return true;
}
Expand Down

0 comments on commit 4be0d47

Please sign in to comment.