dongjoon-hyun commented on a change in pull request #21668: [SPARK-24690][SQL]
Add a config to control plan stats computation in LogicalRelation
URL: https://github.com/apache/spark/pull/21668#discussion_r349382015
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala
##########
@@ -375,16 +375,16 @@ case class CatalogStatistics(
* Convert [[CatalogStatistics]] to [[Statistics]], and match column stats
to attributes based
* on column names.
*/
- def toPlanStats(planOutput: Seq[Attribute], cboEnabled: Boolean): Statistics
= {
- if (cboEnabled && rowCount.isDefined) {
+ def toPlanStats(planOutput: Seq[Attribute], planStatsEnabled: Boolean):
Statistics = {
+ if (planStatsEnabled && rowCount.isDefined) {
val attrStats = AttributeMap(planOutput
.flatMap(a => colStats.get(a.name).map(a -> _.toPlanStat(a.name,
a.dataType))))
// Estimate size as number of rows * row size.
val size = EstimationUtils.getOutputSize(planOutput, rowCount.get,
attrStats)
Statistics(sizeInBytes = size, rowCount = rowCount, attributeStats =
attrStats)
} else {
- // When CBO is disabled or the table doesn't have other statistics, we
apply the size-only
- // estimation strategy and only propagate sizeInBytes in statistics.
+ // When plan statistics are disabled or the table doesn't have other
statistics,
+ // we apply the size-only estimation strategy and only propagate
sizeInBytes in statistics.
Statistics(sizeInBytes = sizeInBytes)
Review comment:
@maropu and @gatorsmile . This comment seems valid until now. Is it beyond
of the scope in this PR?
----------------------------------------------------------------
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]