Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/16529#discussion_r95359715
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
---
@@ -495,11 +501,19 @@ case class Aggregate(
child.constraints.union(getAliasedConstraints(nonAgg))
}
- override lazy val statistics: Statistics =
AggregateEstimation.estimate(this).getOrElse {
- if (groupingExpressions.isEmpty) {
- super.statistics.copy(sizeInBytes = 1)
+ override def computeStats(conf: CatalystConf): Statistics = {
+ def simpleEstimation: Statistics = {
+ if (groupingExpressions.isEmpty) {
+ super.computeStats(conf).copy(sizeInBytes = 1)
+ } else {
+ super.computeStats(conf)
+ }
+ }
+
+ if (conf.cboEnabled) {
+ AggregateEstimation.estimate(conf, this).getOrElse(simpleEstimation)
--- End diff --
This is not same as it was. Now we may call `AggregateEstimation.estimate`
even if grouping expressions is empty.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]