Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-19842 Informational Referential Integrity Constraints Support in Spark
  3. SPARK-22064

Add support for VALIDATE option to ALTER TABLE ADD CONSTRAINT command

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.0
    • None
    • SQL
    • 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            ksunitha Sunitha Kambhampati
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: