kishendas commented on a change in pull request #1095:
URL: https://github.com/apache/hive/pull/1095#discussion_r446443069
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
##########
@@ -2368,6 +2368,36 @@ public static TableSnapshot
getTableSnapshot(Configuration conf,
validWriteIdList != null ? validWriteIdList.toString() : null);
}
+ /**
+ * This is called by Driver.java for all write operations (DDL). This
updates the latest validWriteIdList in config,
+ * so that the same can be sent from HMS Client during invocation of get_*
HMS APIs.
+ */
+ public static ValidWriteIdList updateValidWriteIdList(HiveConf conf, String
fullTableName) throws LockException {
+
+ HiveTxnManager txnMgr = SessionState.get().getTxnMgr();
+ List<String> txnTables = new ArrayList<>();
+ txnTables.add(fullTableName);
+ ValidTxnWriteIdList txnWriteIds;
+ if (conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY) != null) {
+ txnWriteIds = new ValidTxnWriteIdList(conf.get(
+ ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY));
+ } else {
+ String txnString;
+ if (conf.get(ValidTxnList.VALID_TXNS_KEY) != null) {
+ txnString = conf.get(ValidTxnList.VALID_TXNS_KEY);
+ } else {
+ ValidTxnList txnIds = txnMgr.getValidTxns();
Review comment:
Makes sense
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]