cloud-fan commented on code in PR #49442:
URL: https://github.com/apache/spark/pull/49442#discussion_r1913177563
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/parameters.scala:
##########
@@ -176,15 +162,18 @@ object BindParameters extends ParameterizedQueryProcessor
with QueryErrorsBase {
}
}
- private def bind(p: LogicalPlan)(f: PartialFunction[Expression,
Expression]): LogicalPlan = {
- p.resolveExpressionsWithPruning(_.containsPattern(PARAMETER)) (f orElse {
- case sub: SubqueryExpression => sub.withNewPlan(bind(sub.plan)(f))
- })
+ private def bind(p0: LogicalPlan)(f: PartialFunction[Expression,
Expression]): LogicalPlan = {
+ var stop = false
+ p0.resolveOperatorsDownWithPruning(_.containsPattern(PARAMETER) && !stop) {
+ case p1 =>
+ stop = p1.isInstanceOf[ParameterizedQuery]
Review Comment:
BTW I think this pattern is common enough, maybe the TreeNode transform down
methods should take an extra `stopCondition: T => Boolean` parameter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]