Skip to content

AlterTableAddConstraint

AlterTableAddConstraint is an AlterTableCommand (Spark SQL) that represents ALTER TABLE ADD CONSTRAINT SQL command for CHECK constraints.

Creating Instance

AlterTableAddConstraint takes the following to be created:

  • Table (LogicalPlan)
  • Constraint Name
  • Constraint SQL Expression (text)

AlterTableAddConstraint is created when:

Table Changes

changes: Seq[TableChange]

changes is part of the AlterTableCommand (Spark SQL) abstraction.


changes gives a single-element collection with an AddConstraint (with the constraintName and expr).