Github user maropu commented on a diff in the pull request: https://github.com/apache/spark/pull/21668#discussion_r199682495 --- Diff: 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) --- End diff -- yea, I see. We might do so.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org