cloud-fan commented on a change in pull request #29816:
URL: https://github.com/apache/spark/pull/29816#discussion_r492164247
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -703,14 +708,20 @@ object FoldablePropagation extends Rule[LogicalPlan] {
}
}
+ private def collectFoldables(expressions: Seq[NamedExpression]) = {
+ AttributeMap(expressions.collect {
+ case a: Alias if a.child.foldable => (a.toAttribute, a)
+ })
+ }
+
/**
* List of all [[UnaryNode]]s which allow foldable propagation.
*/
private def canPropagateFoldables(u: UnaryNode): Boolean = u match {
// Handling `Project` is moved to `propagateFoldables`.
case _: Filter => true
case _: SubqueryAlias => true
- case _: Aggregate => true
+ // Handling `Aggregate` is moved to `propagateFoldables`.
Review comment:
can we merge this comment with ```// Handling `Project` is moved to
`propagateFoldables`.```?
##########
File path:
sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41.sf100/explain.txt
##########
@@ -73,19 +73,19 @@ Input [2]: [i_manufact#2, count#9]
Keys [1]: [i_manufact#2]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#11]
-Results [3]: [count(1)#11 AS item_cnt#12, i_manufact#2 AS i_manufact#2#13,
true AS alwaysTrue#14]
+Results [2]: [count(1)#11 AS item_cnt#12, i_manufact#2 AS i_manufact#2#13]
Review comment:
This file is a positive change.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]