Skip to content

Commit 8a458be

Browse files
committed
remove extra materialized view locking
1 parent 00e94e0 commit 8a458be

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/alter/rebuild/AlterMaterializedViewRebuildAnalyzer.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -205,23 +205,6 @@ private ASTNode getRewrittenAST(TableName tableName) throws SemanticException {
205205
tableName.getEscapedNotEmptyDbTable(), viewText);
206206
rewrittenAST = ParseUtils.parse(rewrittenInsertStatement, ctx);
207207
this.ctx.addSubContext(ctx);
208-
209-
if (!this.ctx.isExplainPlan() && (AcidUtils.isTransactionalTable(table))) {
210-
// Acquire lock for the given materialized view. Only one rebuild per materialized view can be triggered at a
211-
// given time, as otherwise we might produce incorrect results if incremental maintenance is triggered.
212-
HiveTxnManager txnManager = getTxnMgr();
213-
LockState state;
214-
try {
215-
state = txnManager.acquireMaterializationRebuildLock(
216-
tableName.getDb(), tableName.getTable(), txnManager.getCurrentTxnId()).getState();
217-
} catch (LockException e) {
218-
throw new SemanticException("Exception acquiring lock for rebuilding the materialized view", e);
219-
}
220-
if (state != LockState.ACQUIRED) {
221-
throw new SemanticException(
222-
"Another process is rebuilding the materialized view " + tableName.getNotEmptyDbTable());
223-
}
224-
}
225208
} catch (Exception e) {
226209
throw new SemanticException(e);
227210
}

0 commit comments

Comments
 (0)