DeltaMergeIntoClause¶
DeltaMergeIntoClause
is an extension of the Expression
(Spark SQL) abstraction for WHEN clauses.
Contract¶
Actions¶
actions: Seq[Expression]
Condition¶
condition: Option[Expression]
Implementations¶
Sealed Trait
DeltaMergeIntoClause
is a Scala sealed trait which means that all of the implementations are in the same compilation unit (a single file).
Verifing Actions¶
verifyActions(): Unit
verifyActions
goes over the actions and makes sure that they are either UnresolvedStar
s (Spark SQL) or DeltaMergeActions.
For unsupported actions, verifyActions
throws an IllegalArgumentException
:
Unexpected action expression [action] in [this]
verifyActions
is used when:
DeltaMergeInto
is created
toActions¶
toActions(
assignments: Seq[Assignment]): Seq[Expression]
toActions(
colNames: Seq[UnresolvedAttribute],
exprs: Seq[Expression],
isEmptySeqEqualToStar: Boolean = true): Seq[Expression]
toActions
requires that the numbers of colNames
and exprs
are the same.
toActions
creates one of the following expressions based on the given colNames
and isEmptySeqEqualToStar
flag:
UnresolvedStar
for nocolNames
andisEmptySeqEqualToStar
flag enabled- DeltaMergeActions (for every pair of column name and expression based on
colNames
andexprs
, respectively)
toActions
is used when:
DeltaAnalysis
logical resolution rule is executedDeltaMergeMatchedActionBuilder
is requested to updateAll, addUpdateClause, insertAll and addInsertClauseDeltaMergeIntoUpdateClause
is created
resolvedActions¶
resolvedActions: Seq[DeltaMergeAction]
resolvedActions
...FIXME
resolvedActions
is used when:
- PreprocessTableMerge logical resolution rule is executed
- MergeIntoCommand is executed (and requested to writeInsertsOnlyWhenNoMatchedClauses and writeAllChanges)