CreateStruct Function Builder¶
CreateStruct
is a function builder (e.g. Seq[Expression] => Expression
) that can <
=== [[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 <children
<
-
For <
> expressions that are < >, apply
creates a pair of a <> expression (with the < > of the NamedExpression
) and theNamedExpression
itself -
For <
> expressions that are not < > yet, apply
creates a pair of aNamePlaceholder
expression and theNamedExpression
itself -
For all other <
>, apply
creates a pair of a <> expression (with the value as col[index]
) and theExpression
itself
apply
is used when:
-
ResolveReferences
logical resolution rule is requested to expandStarExpression -
InConversion
type coercion rule is requested tocoerceTypes
-
ExpressionEncoder
is requested to create an ExpressionEncoder for a tuple -
Stack
generator expression is requested to generate a Java source code -
AstBuilder
is requested to parse a struct and row constructor -
ColumnStat
is requested to statExprs -
KeyValueGroupedDataset
is requested to aggUntyped (when KeyValueGroupedDataset.agg typed operator is used) -
<
> typed transformation is used -
struct standard function is used
-
SimpleTypedAggregateExpression
expression is requestedevaluateExpression
andresultObjToRow