maropu commented on a change in pull request #24178:
[SPARK-25196][SPARK-27251][SQL][FOLLOWUP] Add synchronized for
InMemoryRelation.statsOfPlanToCache
URL: https://github.com/apache/spark/pull/24178#discussion_r268373741
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala
##########
@@ -163,12 +161,15 @@ class CacheManager extends Logging {
val relation = cachedData.cachedRepresentation
val (rowCount, newColStats) =
CommandUtils.computeColumnStats(sparkSession, relation, column)
- val oldStats = relation.statsOfPlanToCache
- val newStats = oldStats.copy(
- rowCount = Some(rowCount),
- attributeStats = AttributeMap((oldStats.attributeStats ++
newColStats).toSeq)
- )
- relation.statsOfPlanToCache = newStats
+
+ relation.synchronized {
Review comment:
Looks reasonable, I'll update soon.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]