Skip to content

Commit

Permalink
[Chore](materialized-view) mow table's mv need have all key column (#…
Browse files Browse the repository at this point in the history
…41496)

## Proposed changes
mow table's mv need have all key column
  • Loading branch information
BiteTheDDDDt authored Sep 30, 2024
1 parent e8fb88f commit ce982a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,7 @@ private List<Column> checkAndPrepareMaterializedView(CreateMaterializedViewStmt
}

// check b.3
if (olapTable.getKeysType() == KeysType.UNIQUE_KEYS && !olapTable.getEnableUniqueKeyMergeOnWrite()
&& !addMVClause.isReplay()) {
if (olapTable.getKeysType() == KeysType.UNIQUE_KEYS && !addMVClause.isReplay()) {
Set<String> originColumns = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
for (Column column : newMVColumns) {
originColumns.add(CreateMaterializedViewStmt.mvColumnBreaker(column.getName()));
Expand Down
4 changes: 2 additions & 2 deletions regression-test/data/mv_p0/test_mv_mow/test_mv_mow.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
1 3

-- !select_mv --
1 2
1 3
1 1 1 2
1 2 1 3

-- !select_mv --
1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ suite ("test_mv_mow") {
sql """analyze table u_table with sync;"""
sql "insert into u_table select 1,1,1,1;"
sql "insert into u_table select 1,2,1,1;"
createMV("create materialized view k123p as select k1,k2+k3 from u_table;")
createMV("create materialized view k123p as select k1,k2,k3,k2+k3 from u_table;")

sql "insert into u_table select 1,1,1,2;"
sql "insert into u_table select 1,2,1,2;"
Expand Down

0 comments on commit ce982a9

Please sign in to comment.