关注 spark技术分享,
撸spark源码 玩spark最佳实践

ResolveSubquery

ResolveSubquery Logical Resolution Rule

ResolveSubquery is a logical resolution that resolves subquery expressions (ScalarSubquery, Exists and In) when transforming a logical plan with the following logical operators:

  1. Filter operators with an Aggregate child operator

  2. Unary operators with the children resolved

ResolveSubquery is part of Resolution fixed-point batch of rules of the Spark Analyzer.

Technically, ResolveSubquery is a Catalyst rule for transforming logical plans, i.e. Rule[LogicalPlan].

Resolving Subquery Expressions (ScalarSubquery, Exists and In) — resolveSubQueries Internal Method

resolveSubQueries requests the input logical plan to transform expressions (down the operator tree) as follows:

  1. For ScalarSubquery expressions with subquery plan not resolved and resolveSubQuery to create resolved ScalarSubquery expressions

  2. For Exists expressions with subquery plan not resolved and resolveSubQuery to create resolved Exists expressions

  3. For In expressions with ListQuery not resolved and resolveSubQuery to create resolved In expressions

Note
resolveSubQueries is used exclusively when ResolveSubquery is executed.

resolveSubQuery Internal Method

resolveSubQuery…​FIXME

Note
resolveSubQuery is used exclusively when ResolveSubquery is requested to resolve subquery expressions (ScalarSubquery, Exists and In).

Applying ResolveSubquery to Logical Plan (Executing ResolveSubquery) — apply Method

Note
apply is part of Rule Contract to apply a rule to a TreeNode, e.g. logical plan.

apply transforms the input logical plan as follows:

  1. For Filter operators with an Aggregate operator (as the child operator) and the children resolved, apply resolves subquery expressions (ScalarSubquery, Exists and In) with the Filter operator and the plans with the Aggregate operator and its single child

  2. For unary operators with the children resolved, apply resolves subquery expressions (ScalarSubquery, Exists and In) with the unary operator and its single child

赞(0) 打赏
未经允许不得转载:spark技术分享 » ResolveSubquery
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏