Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-13076 Implement FK/PK "rely novalidate" constraints for better CBO
  3. HIVE-13290

Support primary keys/foreign keys constraint as part of create table command in Hive

    Details

      Description

      SUPPORT for the following statements

      CREATE TABLE product 
        ( 
           product_id        INTEGER, 
           product_vendor_id INTEGER, 
           PRIMARY KEY (product_id)  DISABLE NOVALIDATE, 
           CONSTRAINT product_fk_1 FOREIGN KEY (product_vendor_id) REFERENCES vendor(vendor_id)  DISABLE NOVALIDATE
        ); 
      
      CREATE TABLE vendor 
        ( 
           vendor_id INTEGER, 
           PRIMARY KEY (vendor_id)  DISABLE NOVALIDATE RELY
        ); 
      

      In the above syntax, [CONSTRAINT constraint-Name] is optional. If this is not specified by the user, we will use system generated constraint name. For the purpose of simplicity, we will allow CONSTRAINT option for foreign keys and not primary key since there is only one primary key per table. The RELY/NORELY keyword is also optional.

        Attachments

        1. HIVE-13290.1.patch
          1.07 MB
          Hari Sankar Sivarama Subramaniyan
        2. HIVE-13290.2.patch
          1.32 MB
          Hari Sankar Sivarama Subramaniyan
        3. HIVE-13290.3.patch
          1.36 MB
          Hari Sankar Sivarama Subramaniyan
        4. HIVE-13290.4.patch
          3.74 MB
          Hari Sankar Sivarama Subramaniyan
        5. HIVE-13290.5.patch
          2.11 MB
          Hari Sankar Sivarama Subramaniyan
        6. HIVE-13290.6.patch
          33 kB
          Hari Sankar Sivarama Subramaniyan
        7. HIVE-13290.7.patch
          42 kB
          Hari Sankar Sivarama Subramaniyan
        8. HIVE-13290.8.patch
          43 kB
          Hari Sankar Sivarama Subramaniyan
        9. HIVE-13290.final.patch
          45 kB
          Hari Sankar Sivarama Subramaniyan
        10. test-results.txt
          662 kB
          Hari Sankar Sivarama Subramaniyan

          Issue Links

            Activity

              People

              • Assignee:
                hsubramaniyan Hari Sankar Sivarama Subramaniyan
                Reporter:
                hsubramaniyan Hari Sankar Sivarama Subramaniyan
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: