Skip to content

Commit

Permalink
Add comment around QueryPlan changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Nov 23, 2021
1 parent 7fbd335 commit d0d8db9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]]
def transformExpressionsDownWithPruning(cond: TreePatternBits => Boolean,
ruleId: RuleId = UnknownRuleId)(rule: PartialFunction[Expression, Expression])
: this.type = {
// SPARK-37448: performance optimization: set withOrigin = false in MapExpressions because
// transformDownWithPruning call `CurrentOrigin.withOrigin`:
mapExpressions(_.transformDownWithPruning(cond, ruleId)(rule), withOrigin = false)
}

Expand Down Expand Up @@ -185,6 +187,8 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]]
def transformExpressionsUpWithPruning(cond: TreePatternBits => Boolean,
ruleId: RuleId = UnknownRuleId)(rule: PartialFunction[Expression, Expression])
: this.type = {
// SPARK-37448: performance optimization: set withOrigin = false in MapExpressions because
// transformUpWithPruning call `CurrentOrigin.withOrigin`:
mapExpressions(_.transformUpWithPruning(cond, ruleId)(rule), withOrigin = false)
}

Expand Down

0 comments on commit d0d8db9

Please sign in to comment.