deniskuzZ commented on code in PR #6154:
URL: https://github.com/apache/hive/pull/6154#discussion_r2495501675


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/functions/CommitTxnFunction.java:
##########
@@ -235,12 +245,11 @@ public TxnType execute(MultiDataSourceJdbcResource 
jdbcResource) throws MetaExce
             throw new TxnAbortedException(msg);
           }
         }
-      } else if (!TxnHandler.ConfVars.useMinHistoryLevel()) {
-        jdbcResource.getJdbcTemplate().update(writeSetInsertSql + "FROM 
\"TXN_COMPONENTS\" WHERE \"TC_TXNID\" = :txnId AND \"TC_OPERATION_TYPE\" <> 
:type",
+      } else if (!ConfVars.useMinHistoryLevel()) {
+        jdbcResource.getJdbcTemplate().update(writeSetInsertSql + "FROM 
\"TXN_COMPONENTS\" WHERE \"TC_TXNID\" = :txnId",
             new MapSqlParameterSource()
                 .addValue("txnId", txnid)
-                .addValue("type", OperationType.COMPACT.getSqlConst()));
-        commitId = jdbcResource.execute(new GetHighWaterMarkHandler());
+                .addValue("commitId", txnid));

Review Comment:
   INSERT operations never conflict with other writes, so we can save on DB 
call. 
   The commitId in WRITE_SET is only used to detect conflicts between UPDATE / 
DELETE operations by checking whether their [open, commit] ranges intersect.



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