forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug](materialized-view) fix some bugs on create mv with percentile_a…
…pprox (apache#26528) (apache#26764) 1. percentile_approx have wrong symbol 2. fnCall.getParams() get obsolete childrens
- Loading branch information
1 parent
14d267f
commit 40481a4
Showing
7 changed files
with
79 additions
and
13 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
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
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
12 changes: 12 additions & 0 deletions
12
regression-test/data/mv_p0/test_user_activity/test_user_activity.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,12 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !select_base -- | ||
2023-01-02 450.0 600.0 | ||
|
||
-- !select_star -- | ||
1 2023-01-02 300 | ||
2 2023-01-02 600 | ||
2 2023-01-02 600 | ||
|
||
-- !select_group_mv -- | ||
2023-01-02 600.0 600.0 | ||
|
52 changes: 52 additions & 0 deletions
52
regression-test/suites/mv_p0/test_user_activity/test_user_activity.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,52 @@ | ||
// 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 ("test_user_activity") { | ||
|
||
sql """ DROP TABLE IF EXISTS d_table; """ | ||
|
||
sql """ | ||
CREATE TABLE u_axx ( | ||
r_xx INT, | ||
n_dx DATE, | ||
n_duration INT | ||
) | ||
DISTRIBUTED BY HASH(r_xx) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
""" | ||
|
||
sql """INSERT INTO u_axx VALUES (1, "2023-01-02", 300);""" | ||
sql """INSERT INTO u_axx VALUES (2, "2023-01-02", 600);""" | ||
|
||
qt_select_base " select n_dx, percentile_approx(n_duration, 0.5) as p50, percentile_approx(n_duration, 0.90) as p90 FROM u_axx GROUP BY n_dx; " | ||
|
||
createMV ("create materialized view session_distribution_2 as select n_dx, percentile_approx(n_duration, 0.5) as p50, percentile_approx(n_duration, 0.90) as p90 FROM u_axx GROUP BY n_dx;") | ||
|
||
sql """INSERT INTO u_axx VALUES (2, "2023-01-02", 600);""" | ||
|
||
qt_select_star "select * from u_axx order by 1;" | ||
|
||
explain { | ||
sql("select n_dx, percentile_approx(n_duration, 0.5) as p50, percentile_approx(n_duration, 0.90) as p90 FROM u_axx GROUP BY n_dx;") | ||
contains "(session_distribution_2)" | ||
} | ||
qt_select_group_mv "select n_dx, percentile_approx(n_duration, 0.5) as p50, percentile_approx(n_duration, 0.90) as p90 FROM u_axx GROUP BY n_dx;" | ||
} |