[ 
https://issues.apache.org/jira/browse/HIVE-25512?focusedWorklogId=650934&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-650934
 ]

ASF GitHub Bot logged work on HIVE-25512:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Sep/21 04:06
            Start Date: 15/Sep/21 04:06
    Worklog Time Spent: 10m 
      Work Description: kasakrisz merged pull request #2632:
URL: https://github.com/apache/hive/pull/2632


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 650934)
    Time Spent: 20m  (was: 10m)

> Merge statement does not enforce check constraints
> --------------------------------------------------
>
>                 Key: HIVE-25512
>                 URL: https://issues.apache.org/jira/browse/HIVE-25512
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code}
> set hive.support.concurrency=true;
> set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
> CREATE TABLE table_check_merge(
> name string CHECK (length(name)<=20),
> age int,
> gpa double CHECK (gpa BETWEEN 0.0 AND 4.0)
> ) stored as orc TBLPROPERTIES ('transactional'='true');
> CREATE TABLE table_source( name string, age int, gpa double);
> insert into table_source(name, age, gpa) values ('student1', 16, null), 
> (null, 20, 4.0);
> insert into table_check_merge(name, age, gpa) values ('student1', 16, 2.0);
> merge into table_check_merge using (select age from table_source)source
> on source.age=table_check_merge.age
> when matched then update set gpa=6;
> {code}
> Merge statement tries to update gpa to 6 which is not between 0.0 and 4.0.
> However the update succeeds.



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

Reply via email to