Skip to content

Commit

Permalink
fix cse alias issues
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyang-li committed Sep 2, 2024
1 parent 65cdf22 commit 89b7835
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ class CommonSubexpressionEliminateRule(session: SparkSession, conf: SQLConf)
if (expr.find(_.isInstanceOf[AggregateExpression]).isDefined) {
addToEquivalentExpressions(expr, equivalentExpressions)
} else {
equivalentExpressions.addExprTree(expr)
expr match {
case alias: Alias =>
equivalentExpressions.addExprTree(alias.child)
case _ =>
equivalentExpressions.addExprTree(expr)
}
}
})

Expand Down

0 comments on commit 89b7835

Please sign in to comment.