You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/12/09 10:31:44 UTC
[GitHub] [hudi] xiarixiaoyao commented on a change in pull request #4265: [HUDI-2966] Add TaskCompletionListener for HoodieMergeOnReadRDD to close logScaner when the query finished.
xiarixiaoyao commented on a change in pull request #4265:
URL: https://github.com/apache/hudi/pull/4265#discussion_r765656401
##########
File path: hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/hudi/HoodieMergeOnReadRDD.scala
##########
@@ -84,6 +86,10 @@ class HoodieMergeOnReadRDD(@transient sc: SparkContext,
s"spark partition Index: ${mergeOnReadPartition.index}" +
s"merge type: ${mergeOnReadPartition.split.mergeType}")
}
+ if (iter.isInstanceOf[Closeable]) {
+ Option(TaskContext.get()).foreach(_.addTaskCompletionListener[Unit](_ => iter.asInstanceOf[Closeable].close()))
Review comment:
yes,added some comments。
we can find the example in spark, https://github.com/apache/spark/blob/c51f6449d38d30d0bff22df895dca515898a520b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala#L335
--
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-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org