Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D84119087 for ; Sat, 23 Apr 2016 07:19:13 +0000 (UTC) Received: (qmail 31159 invoked by uid 500); 23 Apr 2016 07:19:13 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 31137 invoked by uid 500); 23 Apr 2016 07:19:13 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 31071 invoked by uid 99); 23 Apr 2016 07:19:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Apr 2016 07:19:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D8DCB2C1F60 for ; Sat, 23 Apr 2016 07:19:12 +0000 (UTC) Date: Sat, 23 Apr 2016 07:19:12 +0000 (UTC) From: "Hari Sankar Sivarama Subramaniyan (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-13290) Support primary keys/foreign keys constraint as part of create table command in Hive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-13290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hari Sankar Sivarama Subramaniyan updated HIVE-13290: ----------------------------------------------------- Status: Patch Available (was: Open) > 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 > 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 > > > SUPPORT for the following statements > {code} > CREATE TABLE product > ( > product_id INTEGER, > product_vendor_id INTEGER, > PRIMARY KEY (product_id), > 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)