pan3793 commented on code in PR #36496:
URL: https://github.com/apache/spark/pull/36496#discussion_r873803127
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala:
##########
@@ -238,7 +238,12 @@ case class CachedRDDBuilder(
}
def isCachedColumnBuffersLoaded: Boolean = {
- _cachedColumnBuffers != null && isCachedRDDLoaded
+ if (_cachedColumnBuffers != null) {
+ _cachedColumnBuffers.synchronized {
+ return _cachedColumnBuffers != null && isCachedRDDLoaded
+ }
+ }
+ false
}
def isCachedRDDLoaded: Boolean = {
Review Comment:
After second thought, I think it doesn't make sense to add `synchronized`
block in `isCacheRDDLoaded`, becuase we need to check `_cachedColumnBuffers !=
null` again and that make `isCacheRDDLoaded` as same as
`isCachedColumnBuffersLoaded`.
Alternatively, I change `isCacheRDDLoaded` to private to avoid accident
un-thread-safe invokes.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]