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

ASF subversion and git services commented on IMPALA-2112:
---------------------------------------------------------

Commit 1f792bea4779229acbaaa40d4904df4546658bfb in impala's branch 
refs/heads/master from Sahil Takiar
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=1f792be ]

IMPALA-9188: Composite primary keys should use same constraint name

After IMPALA-9104, dataload started failing when USE_CDP_HIVE=true
because of HIVE-16603 (Enforce foreign keys to refer to primary keys or
unique keys), which is in Hive 3 but not Hive 2.

This patch fixes a bug from IMPALA-2112 where Impala was generating a
unique constraint name for each column in a composite primary key,
rather than using the same constraint name for each column.

Testing:
* Ran dataload + core tests with USE_CDP_HIVE=[true/false]

Change-Id: I7a91658945b0355753c3cf05be195757b37edaf4
Reviewed-on: http://gerrit.cloudera.org:8080/14792
Reviewed-by: Sahil Takiar <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Support primary key/foreign key constraint as part of create table in Impala
> ----------------------------------------------------------------------------
>
>                 Key: IMPALA-2112
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2112
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Catalog, Frontend
>    Affects Versions: Impala 2.2
>            Reporter: Marcel Kinard
>            Assignee: Anurag Mantripragada
>            Priority: Critical
>              Labels: planner
>
> These would be advisory, ie, Impala would not attempt to enforce them. 
> However, they could be used for cardinality estimation during query planning.
> To be compatible with Hive:
>  * We neither enforce or validate integrity constraints. Hence, DISABLE and 
> NOVALIDATE options are mandatory.
>  * RELY/NORELY is optional. The CBO is expected to use this information when 
> a user specifies “RELY”. The default is NORELY.
>  * Since we do not yet have UNIQUE in Hive, the FK mentioned must be Primary 
> Key column in parent table.
> Support create table syntax like hive does:
>  * {{create table pk(id1 integer, id2 integer, }}{{primary key(id1, id2) 
> DISABLE NOVALIDATE);}}
>  * {{create table fk(id1 integer, id2 integer, }}{{constraint c1 foreign 
> key(id1, id2) references pk(id2, id1) DISABLE NOVALIDATE);}}
>  * {{create table T1(id integer, name string, primary key(id) DISABLE 
> NOVALIDATE RELY}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to