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

Jesus Camacho Rodriguez commented on HIVE-16604:
------------------------------------------------

We could replace ENABLE/DISABLE by [NOT] ENFORCED, since they have a similar 
goal but the latest is SQL standard compliant. If we want to remain backwards 
compatible, we could just add [NOT] ENFORCED as an additional syntax, although 
this might add some confusion for end user. [~ashutoshc], what is your take? In 
both cases, only changes at the parser level are needed, we will not change the 
way that we store the constraints in the metastore.

VALIDATE and NOVALIDATE are used to ensure that existing data in a given table 
conform to the constraint, thus they are only used in ALTER table statements 
when we add a new constraint. Although maybe the standard does not define 
anything similar, I think it is valuable to keep those options, since otherwise 
an ALTER statement will always have to do a full scan on the table data to 
validate that a constraint is not violated, which a user might want to avoid in 
some cases.

RELY and NORELY seem valuable too to make the constraints visible for the query 
optimizer, thus they can remain.

> Use [NOT] ENFORCED for column constraint characteristics
> --------------------------------------------------------
>
>                 Key: HIVE-16604
>                 URL: https://issues.apache.org/jira/browse/HIVE-16604
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 3.0.0
>            Reporter: Carter Shanklin
>            Assignee: Jesus Camacho Rodriguez
>
> From HIVE-16575:
> {quote}
> SQL:2011 spec, 10.8, uses [ NOT ] ENFORCED for column constraint 
> characteristics.
> I think Oracle invented DISABLE and NORELY and maybe others have copied it 
> over time.
> A quick check I see DB2 uses the [ NOT ] ENFORCED. Teradata uses something 
> else entirely.
> Personally I think there are advantages to adopting the standard approach.
> There is no standard approach for hinting the optimizer so we're on our own 
> there.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to