pvary commented on a change in pull request #1095:
URL: https://github.com/apache/hive/pull/1095#discussion_r439258843
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
##########
@@ -795,7 +804,13 @@ public void alterTable(String catName, String dbName,
String tblName, Table newT
// Take a table snapshot and set it to newTbl.
AcidUtils.TableSnapshot tableSnapshot = null;
if (transactional) {
- if (replWriteId > 0) {
+ if (AcidUtils.isTransactionalTable(newTbl) && !inReplication(newTbl)
&& replWriteId > 0) {
+ txnOpened = openTxnIfNeeded();
Review comment:
So txn is opened for every query in Compiler.analyze() - The we do not
need to check the openTxns everywhere.
The writeId is requested in Driver.acquireLocks() - We might want to change
the logic there, so writeId is requested for the table. I think it is much
better to do these things in a single place than spreading out all over the code
----------------------------------------------------------------
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]