Skip to content

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:

enforcesGeneratedColumns

enforcesGeneratedColumns(
  protocol: Protocol,
  metadata: Metadata): Boolean

enforcesGeneratedColumns is true when the following all hold:

enforcesGeneratedColumns is used when:

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:

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 name
  • EqualNullSafe 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:


Last update: 2021-06-14
Back to top