Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B3A2E200C80 for ; Thu, 25 May 2017 12:30:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B1788160BCA; Thu, 25 May 2017 10:30:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 04235160BC7 for ; Thu, 25 May 2017 12:30:07 +0200 (CEST) Received: (qmail 96856 invoked by uid 500); 25 May 2017 10:30:07 -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 96847 invoked by uid 99); 25 May 2017 10:30:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 May 2017 10:30:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B7995C0715 for ; Thu, 25 May 2017 10:30:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id gu91X373ktTR for ; Thu, 25 May 2017 10:30:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 983185F249 for ; Thu, 25 May 2017 10:30:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1D9D7E0BDF for ; Thu, 25 May 2017 10:30:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 43A8021B5A for ; Thu, 25 May 2017 10:30:04 +0000 (UTC) Date: Thu, 25 May 2017 10:30:04 +0000 (UTC) From: "Jesus Camacho Rodriguez (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-16575) Support for 'UNIQUE' and 'NOT NULL' constraints MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 25 May 2017 10:30:08 -0000 [ https://issues.apache.org/jira/browse/HIVE-16575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jesus Camacho Rodriguez updated HIVE-16575: ------------------------------------------- Resolution: Fixed Fix Version/s: 3.0.0 Status: Resolved (was: Patch Available) Pushed to master, thanks for reviewing [~ashutoshc]! > Support for 'UNIQUE' and 'NOT NULL' constraints > ----------------------------------------------- > > Key: HIVE-16575 > URL: https://issues.apache.org/jira/browse/HIVE-16575 > Project: Hive > Issue Type: New Feature > Components: CBO, Logical Optimizer, Parser > Reporter: Jesus Camacho Rodriguez > Assignee: Jesus Camacho Rodriguez > Fix For: 3.0.0 > > Attachments: HIVE-16575.01.patch, HIVE-16575.02.patch, HIVE-16575.03.patch, HIVE-16575.04.patch, HIVE-16575.patch > > > Follow-up on HIVE-13076. > This issue add support for SQL 'UNIQUE' and 'NOT NULL' constraints when we create a table / alter a table (https://www.postgresql.org/docs/9.6/static/sql-createtable.html). > As with PK and FK constraints, currently we do not enforce them; thus, the constraints need to use the DISABLE option, but they will be stored and can be enabled for rewriting/optimization using RELY. > This patch also adds support for inlining the constraints next to the column type definition, i.e., 'column constraints'. > Some examples of the extension to the syntax included in the patch: > {code:sql} > CREATE TABLE table3 (x string NOT NULL DISABLE, PRIMARY KEY (x) DISABLE, CONSTRAINT fk1 FOREIGN KEY (x) REFERENCES table2(a) DISABLE); > CREATE TABLE table4 (x string CONSTRAINT nn4_1 NOT NULL DISABLE, y string CONSTRAINT nn4_2 NOT NULL DISABLE, UNIQUE (x) DISABLE, CONSTRAINT fk2 FOREIGN KEY (x) REFERENCES table2(a) DISABLE, > CONSTRAINT fk3 FOREIGN KEY (y) REFERENCES table2(a) DISABLE); > CREATE TABLE table12 (a STRING CONSTRAINT nn12_1 NOT NULL DISABLE NORELY, b STRING); > CREATE TABLE table13 (a STRING NOT NULL DISABLE RELY, b STRING); > CREATE TABLE table14 (a STRING CONSTRAINT nn14_1 NOT NULL DISABLE RELY, b STRING); > CREATE TABLE table15 (a STRING REFERENCES table4(x) DISABLE, b STRING); > CREATE TABLE table16 (a STRING CONSTRAINT nn16_1 REFERENCES table4(x) DISABLE RELY, b STRING); > ALTER TABLE table16 CHANGE a a STRING REFERENCES table4(x) DISABLE NOVALIDATE; > ALTER TABLE table12 CHANGE COLUMN b b STRING CONSTRAINT nn12_2 NOT NULL DISABLE NOVALIDATE; > ALTER TABLE table13 CHANGE b b STRING NOT NULL DISABLE NOVALIDATE; > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)