Skip to content

Commit

Permalink
Address comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed May 24, 2017
1 parent e4940b9 commit 14e09aa
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,9 @@ object ParquetFileFormat extends Logging {
partFiles: Seq[FileStatus],
ignoreCorruptFiles: Boolean): Seq[Footer] = {
val parFiles = partFiles.par
val readParquetTaskSupport = new ForkJoinTaskSupport(new ForkJoinPool(8))
parFiles.tasksupport = readParquetTaskSupport
val footers = parFiles.flatMap { currentFile =>
val pool = new ForkJoinPool(8)
parFiles.tasksupport = new ForkJoinTaskSupport(pool)
parFiles.flatMap { currentFile =>
try {
// Skips row group information since we only need the schema.
// ParquetFileReader.readFooter throws RuntimeException, instead of IOException,
Expand All @@ -496,10 +496,10 @@ object ParquetFileFormat extends Logging {
} else {
throw new IOException(s"Could not read footer for file: $currentFile", e)
}
} finally {
pool.shutdown()
}
}.seq
readParquetTaskSupport.forkJoinPool.shutdown()
footers
}

/**
Expand Down

0 comments on commit 14e09aa

Please sign in to comment.