We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e678b9f commit ae0e447Copy full SHA for ae0e447
sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTableOperations.scala
@@ -298,11 +298,15 @@ case class InsertIntoParquetTable(
298
val committer = format.getOutputCommitter(hadoopContext)
299
committer.setupTask(hadoopContext)
300
val writer = format.getRecordWriter(hadoopContext)
301
- while (iter.hasNext) {
302
- val row = iter.next()
303
- writer.write(null, row)
+ try {
+ while (iter.hasNext) {
+ val row = iter.next()
304
+ writer.write(null, row)
305
+ }
306
307
+ finally {
308
+ writer.close(hadoopContext)
309
}
- writer.close(hadoopContext)
310
committer.commitTask(hadoopContext)
311
return 1
312
0 commit comments