maropu commented on a change in pull request #32659:
URL: https://github.com/apache/spark/pull/32659#discussion_r647129296



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/EstimationUtils.scala
##########
@@ -80,6 +80,54 @@ object EstimationUtils {
     expressions.collect {
       case alias @ Alias(attr: Attribute, _) if attributeStats.contains(attr) 
=>
         alias.toAttribute -> attributeStats(attr)
+      case alias @ Alias(expn: Expression, _) if isExpressionStatsExist(expn, 
attributeStats) =>
+        getExpressionStats(alias.toAttribute, expn, attributeStats)
+    }
+  }
+
+  // Support for substring expressions.
+  // TODO: Support for more expressions like Multiply.

Review comment:
       Why do we need to handle individual exprs here? For aggregate stat 
estimation, we cannot just use upper-bound stat values from a child plan in 
`AggregateEstimation`?




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to