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

ExtractWindowExpressions

ExtractWindowExpressions Logical Resolution Rule

ExtractWindowExpressions is a logical resolution rule that transforms a logical query plan and replaces (extracts) WindowExpression expressions with Window logical operators.

ExtractWindowExpressions is part of the Resolution fixed-point batch in the standard batches of the Analyzer.

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

Note
ExtractWindowExpressions is a Scala object inside Analyzer class (so you have to create an instance of the Analyzer class to access it or simply use SessionState).

Executing Rule — apply Method

Note
apply is part of the Rule Contract to execute (apply) a rule on a TreeNode (e.g. LogicalPlan).

hasWindowFunction Internal Method

  1. Executes the other hasWindowFunction on every NamedExpression in the projectList

hasWindowFunction is positive (true) when the input expr named expression is a WindowExpression expression. Otherwise, hasWindowFunction is negative (false).

Note
hasWindowFunction is used when ExtractWindowExpressions logical resolution rule is requested to extract and execute.

extract Internal Method

extract…​FIXME

Note
extract is used exclusively when ExtractWindowExpressions logical resolution rule is executed.

Adding Project and Window Logical Operators to Logical Plan — addWindow Internal Method

addWindow adds a Project logical operator with one or more Window logical operators (for every WindowExpression in the input named expressions) to the input logical plan.

Internally, addWindow…​FIXME

Note
addWindow is used exclusively when ExtractWindowExpressions logical resolution rule is executed.
赞(0) 打赏
未经允许不得转载:spark技术分享 » ExtractWindowExpressions
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏