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

CreateStruct Function Builder

CreateStruct Function Builder

CreateStruct is a function builder (e.g. Seq[Expression] ⇒ Expression) that can create CreateNamedStruct expressions and is the metadata of the struct function.

Metadata of struct Function — registryEntry Property

registryEntry…​FIXME

Note
registryEntry is used exclusively when FunctionRegistry is requested for the function expression registry.

Creating CreateNamedStruct Expression — apply Method

Note
apply is part of Scala’s scala.Function1 contract to create a function of one parameter (e.g. Seq[Expression]).

apply creates a CreateNamedStruct expression with the input children expressions as follows:

  • For NamedExpression expressions that are resolved, apply creates a pair of a Literal expression (with the name of the NamedExpression) and the NamedExpression itself

  • For NamedExpression expressions that are not resolved yet, apply creates a pair of a NamePlaceholder expression and the NamedExpression itself

  • For all other expressions, apply creates a pair of a Literal expression (with the value as col[index]) and the Expression itself

Note

apply is used when:

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

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏