deniskuzZ commented on code in PR #6434:
URL: https://github.com/apache/hive/pull/6434#discussion_r3139529404
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/alter/rebuild/AlterMaterializedViewRebuildAnalyzer.java:
##########
@@ -179,6 +179,24 @@ public void analyzeInternal(ASTNode root) throws
SemanticException {
LOG.debug("Rebuilding materialized view " +
tableName.getNotEmptyDbTable());
super.analyzeInternal(rewrittenAST);
+
+ if (!this.ctx.isExplainPlan() && AcidUtils.isTransactionalTable(mvTable)) {
+ // Acquire lock for the given materialized view. Only one rebuild per
materialized view can be triggered at a
+ // given time, as otherwise we might produce incorrect results if
incremental maintenance is triggered.
+ HiveTxnManager txnManager = getTxnMgr();
+ LockState state;
+ try {
+ state = txnManager.acquireMaterializationRebuildLock(new
LockMaterializationRebuildRequest(tableName.getCat(),
Review Comment:
ok, so you've restored the locking functionality?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]