File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package org.apache.spark.sql.catalyst.expressions
1919
2020import scala .collection .mutable
2121
22+ import org .apache .spark .TaskContext
2223import org .apache .spark .sql .catalyst .expressions .codegen .CodegenFallback
2324import org .apache .spark .sql .catalyst .expressions .objects .LambdaVariable
2425
@@ -74,8 +75,8 @@ class EquivalentExpressions {
7475 // loop. So we can't evaluate sub-expressions containing `LambdaVariable` at the beginning.
7576 expr.find(_.isInstanceOf [LambdaVariable ]).isDefined ||
7677 // `PlanExpression` wraps query plan. To compare query plans of `PlanExpression` on executor,
77- // can cause unexpected error.
78- expr.isInstanceOf [PlanExpression [_]]
78+ // can cause error like NPE .
79+ ( expr.isInstanceOf [PlanExpression [_]] && TaskContext .get != null )
7980
8081 // There are some special expressions that we should not recurse into all of its children.
8182 // 1. CodegenFallback: it's children will not be used to generate code (call eval() instead)
You can’t perform that action at this time.
0 commit comments