Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@ explain cbo
alter materialized view mat1 rebuild;

alter materialized view mat1 rebuild;
select * from mat1;

insert into tbl_ice values (20, 'twenty', 30);

alter materialized view mat1 rebuild;
select * from mat1;
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,30 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
five 54
four 53
ten 60
PREHOOK: query: insert into tbl_ice values (20, 'twenty', 30)
PREHOOK: type: QUERY
PREHOOK: Input: _dummy_database@_dummy_table
PREHOOK: Output: default@tbl_ice
POSTHOOK: query: insert into tbl_ice values (20, 'twenty', 30)
POSTHOOK: type: QUERY
POSTHOOK: Input: _dummy_database@_dummy_table
POSTHOOK: Output: default@tbl_ice
PREHOOK: query: alter materialized view mat1 rebuild
PREHOOK: type: ALTER_MATERIALIZED_VIEW_REBUILD
PREHOOK: Input: default@tbl_ice
PREHOOK: Output: default@mat1
POSTHOOK: query: alter materialized view mat1 rebuild
POSTHOOK: type: ALTER_MATERIALIZED_VIEW_REBUILD
POSTHOOK: Input: default@tbl_ice
POSTHOOK: Output: default@mat1
PREHOOK: query: select * from mat1
PREHOOK: type: QUERY
PREHOOK: Input: default@mat1
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: select * from mat1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@mat1
POSTHOOK: Output: hdfs://### HDFS PATH ###
five 54
four 53
ten 60
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ private ASTNode getRewrittenAST(TableName tableName) throws SemanticException {
rewrittenAST = ParseUtils.parse(rewrittenInsertStatement, ctx);
this.ctx.addSubContext(ctx);

if (!this.ctx.isExplainPlan() && (AcidUtils.isTransactionalTable(table) ||
table.isNonNative() && table.getStorageHandler().areSnapshotsSupported())) {
if (!this.ctx.isExplainPlan() && AcidUtils.isTransactionalTable(table)) {
// 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();
Expand Down
Loading