Constraints Utility¶
Extracting All Constraints¶
getAll(
metadata: Metadata,
spark: SparkSession): Seq[Constraint]
getAll extracts CHECK constraints (from the given table metadata).
getAll extracts invariants (from the schema of the given table metadata).
In the end, getAll returns the CHECK constraints and invariants.
getAll is used when:
TransactionalWriteis requested to write data out
Extracting Check Constraints from Table Metadata¶
getCheckConstraints(
metadata: Metadata,
spark: SparkSession): Seq[Constraint]
getCheckConstraints extracts Check constraints from the delta.constraints.-keyed entries in the configuration of the given Metadata:
- The name is the key without the
delta.constraints.prefix - The expression is the value parsed
getCheckConstraints is used when:
Constraintsutility is used to extract all constraintsProtocolutility is used to determine the required minimum protocol