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 @@ -304,8 +304,7 @@ public Plan visitLogicalFilter(LogicalFilter<? extends Plan> filter, ValidateCon
Column column = ((SlotReference) slot).getOriginalColumn().orElse(null);
if (column != null) {
if (column.isVisible()) {
AggregateType aggregateType = column.getAggregationType();
if (aggregateType != null && aggregateType != AggregateType.NONE) {
if (context.keysType.isAggregationFamily() && !column.isKey()) {
throw new AnalysisException(String.format(
"The where clause contained aggregate column is not supported, expr is %s",
expr));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,20 @@ suite ("test_uniq_mv_useless") {

createMV ("create materialized view k1_k2_u21 as select k2 as a1,k1 as a2 from ${testTable};")
sql "insert into ${testTable} select 4,4,4;"

sql """ DROP TABLE IF EXISTS test_uniq_mv_useless_mow_table; """
sql """
create table test_uniq_mv_useless_mow_table (
k1 int null,
k2 int null,
k3 int
)
unique key (k1,k2)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1", "enable_unique_key_merge_on_write" = "true");
"""
test {
sql "create materialized view k1_k2_u12 as select k1 as a1,k2 as a2 from test_uniq_mv_useless_mow_table where k3 > 0;"
exception "The where clause contained aggregate column is not supported"
}
}
Loading