deniskuzZ commented on code in PR #3576: URL: https://github.com/apache/hive/pull/3576#discussion_r1118766777
########## ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java: ########## @@ -395,6 +399,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() + .collect(Collectors.toMap(Function.identity(), table -> getMinOpenWriteId(txnWriteIds, table))); + + if (!writeIds.isEmpty()) { + try { + getMS().addWriteIdsToMinHistory(txnId, writeIds); + } catch (TException | LockException e) { + throw new RuntimeException(ErrorMsg.METASTORE_COMMUNICATION_FAILED.getMsg(), e); + } + } + } + + private Long getMinOpenWriteId(ValidTxnWriteIdList txnWriteIds, String table) { Review Comment: it's used in a lambda -- 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-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org