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), (11,12,1,3), (5,13,1,3);
   
   merge into target t using source s on t.a=s.a 
         when matched then update set b=s.b 
         when not matched then insert values(s.a, s.b, s.p, s.q); 
   ````
   COMPLETED_TXN_COMPONENTS:
   ````
   CTC_TXNID   CTC_DATABASE   CTC_TABLE   CTC_PARTITION   CTC_TIMESTAMP   
CTC_WRITEID   CTC_UPDATE_DELETE   
   5   default   target   p=1/q=2   2022-06-07 05:23:02.748   1   N   
   5   default   target   p=1/q=3   2022-06-07 05:23:02.748   1   N   
   5   default   target   p=2/q=2   2022-06-07 05:23:02.748   1   N   
   8   default   target   p=1/q=3   2022-06-07 05:23:25.464   2   Y   
   8   default   target   p=1/q=3   2022-06-07 05:23:25.464   2   Y   
   8   default   target   p=1/q=2   2022-06-07 05:23:25.464   2   Y   
   8   default   target   p=1/q=3   2022-06-07 05:23:25.464   2   Y  
   ````



-- 
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]

Reply via email to