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 < >, applycreates a pair of a <> expression (with the < > of the NamedExpression) and theNamedExpressionitself -
For <
> expressions that are not < > yet, applycreates a pair of aNamePlaceholderexpression and theNamedExpressionitself -
For all other <
>, applycreates a pair of a <> expression (with the value as col[index]) and theExpressionitself
apply is used when:
-
ResolveReferenceslogical resolution rule is requested to expandStarExpression -
InConversiontype coercion rule is requested tocoerceTypes -
ExpressionEncoderis requested to create an ExpressionEncoder for a tuple -
Stackgenerator expression is requested to generate a Java source code -
AstBuilderis requested to parse a struct and row constructor -
ColumnStatis requested to statExprs -
KeyValueGroupedDatasetis requested to aggUntyped (when KeyValueGroupedDataset.agg typed operator is used) -
<
> typed transformation is used -
struct standard function is used
-
SimpleTypedAggregateExpressionexpression is requestedevaluateExpressionandresultObjToRow