maropu commented on a change in pull request #24047: [SPARK-25196][SQL] Extends
the analyze column command for cached tables
URL: https://github.com/apache/spark/pull/24047#discussion_r268069509
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala
##########
@@ -154,6 +155,22 @@ class CacheManager extends Logging {
}
}
+ // Analyzes column statistics in the given cache data
+ private[sql] def analyzeColumnCacheQuery(
+ sparkSession: SparkSession,
+ cachedData: CachedData,
+ column: Seq[Attribute]): Unit = {
+ 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
Review comment:
@dongjoon-hyun On second thought, we need lock here as you suggested before.
Could you check again? https://github.com/apache/spark/pull/24178
----------------------------------------------------------------
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]