You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Lefty Leverenz (JIRA)" <ji...@apache.org> on 2016/06/18 05:55:05 UTC

[jira] [Commented] (HIVE-13290) Support primary keys/foreign keys constraint as part of create table command in Hive

    [ https://issues.apache.org/jira/browse/HIVE-13290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15337576#comment-15337576 ] 

Lefty Leverenz commented on HIVE-13290:
---------------------------------------

See the PDF doc attached to HIVE-13076:

* https://issues.apache.org/jira/secure/attachment/12803522/AddingPKFKconstraints.pdf

> Support primary keys/foreign keys constraint as part of create table command in Hive
> ------------------------------------------------------------------------------------
>
>                 Key: HIVE-13290
>                 URL: https://issues.apache.org/jira/browse/HIVE-13290
>             Project: Hive
>          Issue Type: Sub-task
>          Components: CBO, Logical Optimizer
>            Reporter: Hari Sankar Sivarama Subramaniyan
>            Assignee: Hari Sankar Sivarama Subramaniyan
>              Labels: TODOC2.1
>             Fix For: 2.1.0
>
>         Attachments: HIVE-13290.1.patch, HIVE-13290.2.patch, HIVE-13290.3.patch, HIVE-13290.4.patch, HIVE-13290.5.patch, HIVE-13290.6.patch, HIVE-13290.7.patch, HIVE-13290.8.patch, HIVE-13290.final.patch, test-results.txt
>
>
> SUPPORT for the following statements
> {code}
> 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
>   ); 
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)