Skip to content

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:

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: