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

Hari Sankar Sivarama Subramaniyan commented on HIVE-13350:
----------------------------------------------------------

[~alangates] This should be an alter command which can add PK/FK with rely/no 
rely option. 
 We wont support validate/enable option for now since we have no ability to 
validate a PK/FK as you mentioned. i.e. we should support the following command 
:
{code}
ALTER TABLE s ADD CONSTRAINT s_fk
FOREIGN KEY (t_id) REFERENCES t (t_id) 
RELY DISABLE NOVALIDATE;
{code}

If the user does not specify any rely/disable/novalidate option the default 
will be norely disable novalidate.
Thus it is a limited feature which will eventually help the optimizer in making 
a query rewrite by removing unnecessary joins if the constraint is marked as 
rely disable novalidate. We are not concentrating on the data integrity aspect 
for now.

Here is the matrix of what all options are intended to be supported as part of 
this jira:

RELY   ENABLE  VALIDATE  - Not to be supported as of now.
NORELY ENABLE VALIDATE - Not to be supported as of now.
RELY DISABLE VALIDATE - Not to be supported as of now.
RELY DISABLE NOVALIDATE - Yes, to be supported
NORELY DISABLE NOVALIDATE - Yes, to be supported
RELY ENABLE NOVALIDATE - Not to be supported as of now.
NORELY ENABLE NOVALIDATE - Not to be supported as of now.
NORELY DISABLE VALIDATE - Not be supported as of now.

Thanks
Hari




> Support Alter commands for Rely/NoRely  novalidate for PK/FK constraints
> ------------------------------------------------------------------------
>
>                 Key: HIVE-13350
>                 URL: https://issues.apache.org/jira/browse/HIVE-13350
>             Project: Hive
>          Issue Type: Sub-task
>          Components: CBO, Logical Optimizer
>            Reporter: Hari Sankar Sivarama Subramaniyan
>            Assignee: Hari Sankar Sivarama Subramaniyan
>




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

Reply via email to