GeneratedColumn Utility¶
isGeneratedColumn¶
isGeneratedColumn(
protocol: Protocol,
field: StructField): Boolean
isGeneratedColumn(
field: StructField): Boolean
isGeneratedColumn
is true
when the metadata of the StructField
contains generation expression.
getGeneratedColumns¶
getGeneratedColumns(
snapshot: Snapshot): Seq[StructField]
getGeneratedColumns
...FIXME
getGeneratedColumns
is used when:
- PreprocessTableUpdate logical resolution rule is executed (and toCommand)
enforcesGeneratedColumns¶
enforcesGeneratedColumns(
protocol: Protocol,
metadata: Metadata): Boolean
enforcesGeneratedColumns
is true
when the following all hold:
- satisfyGeneratedColumnProtocol with the Protocol
- There is at least one generated column in the schema of the Metadata
enforcesGeneratedColumns
is used when:
TransactionalWrite
is requested to write data out (and normalizeData)
removeGenerationExpressions¶
removeGenerationExpressions(
schema: StructType): StructType
removeGenerationExpressions
...FIXME
removeGenerationExpressions
is used when:
- FIXME
satisfyGeneratedColumnProtocol¶
satisfyGeneratedColumnProtocol(
protocol: Protocol): Boolean
satisfyGeneratedColumnProtocol
is true
when the minWriterVersion of the Protocol is at least 4
.
satisfyGeneratedColumnProtocol
is used when:
GeneratedColumn
utility is used to isGeneratedColumn, getGeneratedColumns and enforcesGeneratedColumnsOptimisticTransactionImpl
is requested to updateMetadataImplicitMetadataOperation
is requested to updateMetadata
addGeneratedColumnsOrReturnConstraints¶
addGeneratedColumnsOrReturnConstraints(
deltaLog: DeltaLog,
queryExecution: QueryExecution,
schema: StructType,
df: DataFrame): (DataFrame, Seq[Constraint])
addGeneratedColumnsOrReturnConstraints
returns a DataFrame
with generated columns (missing in the schema) and constraints for generated columns (existing in the schema).
addGeneratedColumnsOrReturnConstraints
finds generated columns (among the top-level columns in the given schema (StructType)).
For every generated column, addGeneratedColumnsOrReturnConstraints
creates a Check constraint with the following:
Generated Column
nameEqualNullSafe
expression that compares the generated column expression with the value provided by the user
In the end, addGeneratedColumnsOrReturnConstraints
uses select
operator on the given DataFrame
.
addGeneratedColumnsOrReturnConstraints
is used when:
TransactionalWrite
is requested to write data out (and normalizeData)