Skip to content
Merged
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 @@ -271,6 +271,9 @@ public Plan visitLogicalOlapScan(LogicalOlapScan olapScan, ValidateContext valid
if (olapTable.isTemporary()) {
throw new AnalysisException("do not support create materialized view on temporary table");
}
if (olapScan.isDirectMvScan()) {
throw new AnalysisException("do not support create materialized view on another synchronized mv");
}
validateContext.baseIndexName = olapTable.getName();
validateContext.dbName = olapTable.getDBName();
validateContext.keysType = olapTable.getKeysType();
Expand Down
12 changes: 12 additions & 0 deletions regression-test/suites/mv_p0/test_create_mv/test_create_mv.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,16 @@ suite("test_create_mv") {
}
}
}
multi_sql """
drop table if exists t_mv_on_mv;
create table t_mv_on_mv( id int, value int)
partition by range(id)( partition p1 values[('1'), ('2')), partition p2 values[('2'), ('3')), partition p3 values[('3'), ('4')), partition p4 values[('4'), ('5')), partition p5 values[('5'), ('6')))distributed by hash(id)properties( 'replication_num'='1');

insert into t_mv_on_mv values (1, 1), (1, 2),(2, 1), (2, 2), (3, 1), (3, 2),(4, 1), (4, 2),(5, 1), (5, 2);
"""
createMV("""CREATE MATERIALIZED VIEW mv1 as select id as col1, sum(value) as col2 from t_mv_on_mv group by id;""")
test {
sql """CREATE MATERIALIZED VIEW mv2 as select col1 as aa, count(col2) as bb from t_mv_on_mv index mv1 group by col1; """
exception "do not support create materialized view on another synchronized mv"
}
}
Loading