Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.1.0
-
None
-
None
Description
As part of the Informational Referential Integrity constraints feature, in SPARK-21784, the ALTER TABLE ADD CONSTRAINT DDL is added.
ALTER TABLE [db_name.]table_name ADD [CONSTRAINT constraintName]
(PRIMARY KEY (col_names) |
FOREIGN KEY (col_names) REFERENCES [db_name.]table_name [(col_names)])
[VALIDATE | NOVALIDATE] [RELY | NORELY]
In this JIRA, we will add support to add a constraint with the VALIDATE option and perform the validation for the constraint. We will validate the constraint by running specific internal SQL statements to check if the data conforms to the constraint.
E.g
ALTER TABLE employee ADD CONSTRAINT pk1 PRIMARY KEY (empno) VALIDATE RELY
The high level details are in the attached spec in SPARK-19842 in Section 4.2.3 and Section 4.5