File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ object PullOutGroupingExpressions extends Rule[LogicalPlan] {
52
52
val newGroupingExpressions = a.groupingExpressions
53
53
.filterNot(AggregateExpression .containsAggregate)
54
54
.map {
55
- case e if AggregateExpression .isAggregate(e) => e
56
55
case e if ! e.foldable && e.children.nonEmpty =>
57
56
complexGroupingExpressionMap
58
57
.getOrElseUpdate(e.canonicalized, Alias (e, s " _groupingexpression " )())
@@ -62,7 +61,7 @@ object PullOutGroupingExpressions extends Rule[LogicalPlan] {
62
61
if (complexGroupingExpressionMap.nonEmpty) {
63
62
def replaceComplexGroupingExpressions (e : Expression ): Expression = {
64
63
e match {
65
- case _ if AggregateExpression .isAggregate(e) => e
64
+ case _ if e.foldable => e
66
65
case _ if complexGroupingExpressionMap.contains(e.canonicalized) =>
67
66
complexGroupingExpressionMap.get(e.canonicalized).map(_.toAttribute).getOrElse(e)
68
67
case _ => e.mapChildren(replaceComplexGroupingExpressions)
You can’t perform that action at this time.
0 commit comments