Specifies an operation that updates a target column with the given expression.
Specifies an operation that updates a target column with the given expression. The target column may or may not be a nested field and it is specified as a full quoted name or as a sequence of split into parts.
Given a list of target-column expressions and a set of update operations, generate a list of update expressions, which are aligned with given target-column expressions.
Given a list of target-column expressions and a set of update operations, generate a list of update expressions, which are aligned with given target-column expressions.
For update operations to nested struct fields, this method recursively walks down schema tree
and apply the update expressions along the way.
For example, assume table target
has two attributes a and z, where a is of struct type
with 3 fields: b, c and d, and z is of integer type.
Given an update command:
this method works as follows:
generateUpdateExpressions(targetCols=[a,z], updateOps=[(a.b, 1), (a.c, 2), (z, 3)]) generateUpdateExpressions(targetCols=[b,c,d], updateOps=[(b, 1),(c, 2)], pathPrefix=["a"]) end-of-recursion -> returns (1, 2, d) -> return ((1, 2, d), 3)
a list of expressions to read named columns; these named columns can be either the top-level attributes of a table, or the nested fields of a StructType column.
a set of update operations.
the path from root to the current (nested) column. Only used for printing out full column path in error messages.
Trait with helper functions to generate expressions to update target columns, even if they are nested fields.