Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/12468#discussion_r60108072
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/EquivalentExpressions.scala
---
@@ -69,8 +69,15 @@ class EquivalentExpressions {
*/
def addExprTree(root: Expression, ignoreLeaf: Boolean = true): Unit = {
val skip = root.isInstanceOf[LeafExpression] && ignoreLeaf
- // the children of CodegenFallback will not be used to generate code
(call eval() instead)
- if (!skip && !addExpr(root) && !root.isInstanceOf[CodegenFallback]) {
+ // There are some special expressions that we should not recurse into
children.
+ // 1. CodegenFallback: it's children will not be used to generate
code (call eval() instead)
+ // 2. ReferenceToExpressions: it's kind of an explicit
sub-expression elimination.
+ val shouldRecurse = root match {
+ case _: CodegenFallback => false
--- End diff --
a few expressions implement CodegenFallback but only use it in some corner
cases
---
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]