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

UnresolvedFunction

UnresolvedFunction Unevaluable Expression — Logical Representation of Functions in Queries

UnresolvedFunction is an Catalyst expression that represents a function (application) in a logical query plan.

UnresolvedFunction is created as a result of the following:

UnresolvedFunction can never be resolved (and is replaced at analysis phase).

Note
UnresolvedFunction is first looked up in LookupFunctions logical rule and then resolved in ResolveFunctions logical resolution rule.


Given UnresolvedFunction can never be resolved it should not come as a surprise that it cannot be evaluated either (i.e. produce a value given an internal row). When requested to evaluate, UnresolvedFunction simply reports a UnsupportedOperationException.

Note
Unevaluable expressions are expressions that have to be replaced by some other expressions during analysis or optimization (or they fail analysis).
Tip
Use Catalyst DSL’s function or distinctFunction to create a UnresolvedFunction with isDistinct flag off and on, respectively.

Creating UnresolvedFunction (With Database Undefined) — apply Factory Method

apply creates a FunctionIdentifier with the name and no database first and then creates a UnresolvedFunction with the FunctionIdentifier, children and isDistinct flag.

Note

apply is used when:

Creating UnresolvedFunction Instance

UnresolvedFunction takes the following when created:

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

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏