GenerateRowIDs Logical Plan Normalization Rule¶
GenerateRowIDs
is a logical rule (Rule[LogicalPlan]
) that Delta Lake injects into SparkSession
(using DeltaSparkSessionExtension).
Executing Rule¶
apply
transforms the scans on delta tables with Row Tracking enabled in the given LogicalPlan
(Spark SQL) bottom-up.
apply
...FIXME
metadataWithRowTrackingColumnsProjection¶
metadataWithRowTrackingColumnsProjection(
metadata: AttributeReference): NamedExpression
metadataWithRowTrackingColumnsProjection
...FIXME
rowIdExpr¶
rowIdExpr(
metadata: AttributeReference): Expression
rowIdExpr
creates a Coalesce
expression with the following expressions:
row_id
(sub)attribute of the givenAttributeReference
_metadata.row_id
-
Add
expression of thebase_row_id
androw_index
attributes of the givenAttributeReference
_metadata.base_row_id + _metadata.row_index