deniskuzZ commented on code in PR #3214:
URL: https://github.com/apache/hive/pull/3214#discussion_r891036728
##########
standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0-alpha-2.derby.sql:
##########
@@ -570,7 +571,8 @@ CREATE TABLE COMPLETED_TXN_COMPONENTS (
CTC_PARTITION varchar(767),
CTC_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
CTC_WRITEID bigint,
- CTC_UPDATE_DELETE char(1) NOT NULL
+ CTC_UPDATE_DELETE char(1) NOT NULL,
+ CTC_ID bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
Review Comment:
@kovjanos try below scenario:
````
create table target (a int, b int) partitioned by (p int, q int) clustered
by (a) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true');
insert into target partition(p,q) values (1,2,1,2), (3,4,1,2), (5,6,1,3),
(7,8,2,2);
create table source (a int, b int, p int, q int);
insert into source values (9,10,1,2), (3,4,1,2), (11,12,1,3), (5,13,1,3),
(7,8,2,2), (14,15,1,1);
merge into target t using source s on t.a=s.b
when matched and t.a=5 then update set b=s.b
//updates p=1/q=3
when matched and t.a in (3,7) then delete
//deletes from p=1/q=2, p=2/q=2
when not matched and t.a >= 8 then insert values(s.a, s.b, s.p,
s.q); //insert p=1/q=2, p=1/q=3 and new part 1/1
````
COMPLETED_TXN_COMPONENTS:
````
CTC_TXNID CTC_DATABASE CTC_TABLE CTC_PARTITION CTC_TIMESTAMP
CTC_WRITEID CTC_UPDATE_DELETE
5 default target p=2/q=2 2022-06-07 03:07:28.512 1 N
5 default target p=1/q=2 2022-06-07 03:07:28.512 1 N
5 default target p=1/q=3 2022-06-07 03:07:28.512 1 N
````
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]