Skip to content

CreateStruct Function Builder

CreateStruct is a function builder (e.g. Seq[Expression] => Expression) that can <> and is the <> of the <> function.

=== [[apply]] Creating CreateNamedStruct Expression -- apply Method

[source, scala]

apply(children: Seq[Expression]): CreateNamedStruct

NOTE: apply is part of Scala's https://www.scala-lang.org/api/2.11.12/index.html#scala.Function1[scala.Function1] contract to create a function of one parameter (e.g. Seq[Expression]).

apply creates a <> expression with the input children <> as follows:

  • For <> expressions that are <>, apply creates a pair of a <> expression (with the <> of the NamedExpression) and the NamedExpression itself

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

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

apply is used when: