kishendas commented on a change in pull request #1095:
URL: https://github.com/apache/hive/pull/1095#discussion_r443069499
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -12308,16 +12303,99 @@ else if(ast.getChild(0).getType() ==
HiveParser.TOK_FALSE) {
// if phase1Result false return
return false;
}
+
+ // 5. Set write id for HMS client
+ if (getTxnMgr().supportsAcid() &&
conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY) == null) {
+
+ ValidTxnWriteIdList txnWriteIds = null;
+
+ if (conf.get(ValidTxnWriteIdList.COMPACTOR_VALID_TABLES_WRITEIDS_KEY) !=
null) {
+ txnWriteIds = new
ValidTxnWriteIdList(conf.getLong(ValidTxnList.COMPACTOR_VALID_TXNS_ID_KEY, 0));
+ txnWriteIds.addTableValidWriteIdList(
+ new
ValidReaderWriteIdList(conf.get(ValidTxnWriteIdList.COMPACTOR_VALID_TABLES_WRITEIDS_KEY)));
+ } else {
+ List<String> tabNames = new ArrayList<>();
+ for (String tabName : collectTables(qb)) {
+ String fullName = TableName
+ .fromString(tabName, SessionState.get().getCurrentCatalog(),
SessionState.get().getCurrentDatabase())
+ .getDbTable();
+ tabNames.add(fullName);
+ }
+
+ if (!tabNames.isEmpty()) {
+ String txnString = conf.get(ValidTxnList.VALID_TXNS_KEY);
+
+ try {
+ if ((txnString == null) || (txnString.isEmpty())) {
+ txnString = getTxnMgr().getValidTxns().toString();
+ conf.set(ValidTxnList.VALID_TXNS_KEY, txnString);
+ }
+
+ txnWriteIds = getTxnMgr().getValidWriteIds(tabNames, txnString);
Review comment:
I don't think we are allocating any write ID in SematicAnalyzer. Please
feel free to correct my understanding.
----------------------------------------------------------------
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]