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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/functions/CleanTxnToWriteIdTableFunction.java:
##########
@@ -56,32 +38,17 @@ public CleanTxnToWriteIdTableFunction(long 
minTxnIdSeenOpen) {
 
   @Override
   public Void execute(MultiDataSourceJdbcResource jdbcResource) throws 
MetaException {
-    NamedParameterJdbcTemplate jdbcTemplate = jdbcResource.getJdbcTemplate();
-    String sql = TxnHandler.ConfVars.useMinHistoryLevel() ? minHistoryLevelSql 
: noMinHistoryLevelSql;
-    MapSqlParameterSource params = new MapSqlParameterSource()
-        .addValue("abortedState", TxnStatus.ABORTED.getSqlConst(), Types.CHAR);
-    if (!TxnHandler.ConfVars.useMinHistoryLevel()) {
-      params.addValue("openState", TxnStatus.OPEN.getSqlConst(), Types.CHAR);
-    }
-
     // First need to find the min_uncommitted_txnid which is currently seen by 
any open transactions.
     // If there are no txns which are currently open or aborted in the system, 
then current value of
     // max(TXNS.txn_id) could be min_uncommitted_txnid.
-    Long minTxnId = jdbcTemplate.query(sql, params, rs -> {
-      if (rs.next()) {
-        return rs.getLong(1);
-      } else {
-        return null;
-      }
-    });
-
+    Long minTxnId = jdbcResource.execute(new MinUncommittedTxnIdHandler());

Review Comment:
   existing `MinUncommittedTxnIdHandler` wasn't used for unknown reason



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