InvisibleProgrammer commented on code in PR #5186:
URL: https://github.com/apache/hive/pull/5186#discussion_r1568510154


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -705,12 +706,11 @@ public LockResponse lockMaterializationRebuild(String 
dbName, String tableName,
   public boolean heartbeatLockMaterializationRebuild(String dbName, String 
tableName, long txnId) throws MetaException {
     int result = jdbcResource.execute(
         "UPDATE \"MATERIALIZATION_REBUILD_LOCKS\"" +
-            " SET \"MRL_LAST_HEARTBEAT\" = " + Instant.now().toEpochMilli() +
-            " WHERE \"MRL_TXN_ID\" = " + txnId +
-            " AND \"MRL_DB_NAME\" = ?" +
-            " AND \"MRL_TBL_NAME\" = ?",
+            " SET \"MRL_LAST_HEARTBEAT\" = " + 
getEpochFn(jdbcResource.getDatabaseProduct()) +

Review Comment:
   Hi @deniskuzZ . We could extract this into a class as well, but I'm not sure 
if it is a proper idea now:
   Firstly, that ticket is just a bugfix.
   I would rather create a small refactor ticket and walk through the whole 
meterailized view rebuild flow in metastore and collect other places to modify, 
rethink how we handle the last heartbeat timestamps, check if it is possible to 
do batching (for example at HeartbeatTxnRangeFunction) and double check all the 
jdbc calls to make sure they are using paramterized queries and remove String 
contatization leftovers. 
   



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