xuechendi commented on a change in pull request #32717:
URL: https://github.com/apache/spark/pull/32717#discussion_r646282237
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala
##########
@@ -225,10 +228,25 @@ case class CachedRDDBuilder(
_cachedColumnBuffers
}
+ def manualClose[T <: CachedBatch](entry: T): T = {
+ entry match {
+ case o: AutoCloseable =>
+ try {
+ o.close
+ } catch {
+ case NonFatal(e) =>
+ logWarning("Fail to close a memory entry", e)
+ }
+ case _ =>
+ }
+ entry
+ }
+
def clearCache(blocking: Boolean = false): Unit = {
if (_cachedColumnBuffers != null) {
synchronized {
if (_cachedColumnBuffers != null) {
+ _cachedColumnBuffers.foreach(manualClose)
_cachedColumnBuffers.unpersist(blocking)
Review comment:
@cloud-fan , hmm, from our test, since _cachedColumnBuffers is
RDD[CachedBatch], after _cachedColumnBuffers.unpersist(blocking) was called,
the reference of all CachedBatch will be deleted, just like what happened in
MemoryStore.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]