You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "SourabhBadhya (via GitHub)" <gi...@apache.org> on 2023/01/31 14:11:05 UTC

[GitHub] [hive] SourabhBadhya commented on a diff in pull request #3576: HIVE-26704: Cleaner shouldn't be blocked by global min open txnId

SourabhBadhya commented on code in PR #3576:
URL: https://github.com/apache/hive/pull/3576#discussion_r1091985114


##########
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java:
##########
@@ -393,6 +397,32 @@ private boolean allowOperationInATransaction(QueryPlan queryPlan) {
     return false;
   }
 
+  @Override
+  public void addWriteIdsToMinHistory(QueryPlan plan, ValidTxnWriteIdList txnWriteIds) {
+    if (plan.getInputs().isEmpty()) {
+      return;
+    }
+    Map<String, Long> writeIds = plan.getInputs().stream()
+      .filter(input -> !input.isDummy() && AcidUtils.isTransactionalTable(input.getTable()))
+      .map(input -> input.getTable().getFullyQualifiedName())
+      .collect(Collectors.toSet()).stream()

Review Comment:
   Why do we need to collect as set when its going to be converted to a map eventually? 
   Can we write it as this - 
   `.map(input -> input.getTable().getFullyQualifiedName()).collect(Collectors.toMap(Function.identity(), table -> getMinOpenWriteId(txnWriteIds, table)));`



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org