-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature](materialized-view) support ignore not slot is null when cou…
…nt(slot) not has key in mv (#32912) support ignore not slot is null when count(slot) not has key in mv
- Loading branch information
1 parent
9be7e30
commit f6de537
Showing
5 changed files
with
178 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
regression-test/data/mv_p0/mv_ignore_predicate/mv_ignore_predicate.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !select_star -- | ||
\N 4 \N d | ||
-4 -4 -4 d | ||
1 1 1 a | ||
2 2 2 b | ||
3 -3 \N c | ||
5 \N \N \N | ||
|
||
-- !select_mv -- | ||
5 | ||
|
||
-- !select_mv -- | ||
5 | ||
|
59 changes: 59 additions & 0 deletions
59
regression-test/suites/mv_p0/mv_ignore_predicate/mv_ignore_predicate.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
import org.codehaus.groovy.runtime.IOGroovyMethods | ||
|
||
suite ("mv_ignore_predicate") { | ||
|
||
sql """ DROP TABLE IF EXISTS d_table; """ | ||
|
||
sql """ | ||
create table d_table( | ||
k1 int null, | ||
k2 int null, | ||
k3 bigint null, | ||
k4 varchar(100) null | ||
) | ||
duplicate key (k1,k2,k3) | ||
distributed BY hash(k1) buckets 3 | ||
properties("replication_num" = "1"); | ||
""" | ||
|
||
sql "insert into d_table select 1,1,1,'a';" | ||
sql "insert into d_table select 2,2,2,'b';" | ||
sql "insert into d_table select 3,-3,null,'c';" | ||
|
||
createMV("create materialized view kign as select k1,count(k2) from d_table group by k1;") | ||
|
||
sql "insert into d_table select -4,-4,-4,'d';" | ||
sql "insert into d_table(k4,k2) values('d',4);" | ||
sql "insert into d_table select 5,null,null,null;" | ||
|
||
qt_select_star "select * from d_table order by k1;" | ||
|
||
explain { | ||
sql("select count(k2) from d_table;") | ||
contains "(kign)" | ||
} | ||
qt_select_mv "select count(k2) from d_table;" | ||
|
||
explain { | ||
sql("select count(k2) from d_table where k2 is not null;") | ||
contains "(kign)" | ||
} | ||
qt_select_mv "select count(k2) from d_table where k2 is not null;" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters