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.
[fix](mtmv) Fix compensate union all wrongly when query rewrite by ma…
…terialized view (apache#40803) ## Proposed changes This is brought by apache#36056 Not all query after rewritten successfully can compensate union all Such as: mv def sql is as following, partition column is a ```sql select a, b, count(*) from t1 group by a, b ``` Query is as following: ```sq select count(*) from t1 ``` the result is +----------+ | count(*) | +----------+ | 24 | +----------+ after rewritten by materialized view successfully If mv part partition is invalid, can not compensate union all, because result is wrong after compensate union all. +----------+ | count(*) | +----------+ | 24 | | 3 | +----------+ This pr fix this.
- Loading branch information
Showing
6 changed files
with
631 additions
and
5 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
201 changes: 201 additions & 0 deletions
201
regression-test/data/nereids_rules_p0/mv/union_all_compensate/union_all_compensate.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,201 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !query1_0_before -- | ||
28 | ||
|
||
-- !query1_0_after -- | ||
28 | ||
|
||
-- !query1_1_before -- | ||
32 | ||
|
||
-- !query1_1_after -- | ||
32 | ||
|
||
-- !query2_0_before -- | ||
a 4 | ||
b 28 | ||
|
||
-- !query2_0_after -- | ||
a 2 | ||
b 26 | ||
|
||
-- !query3_0_before -- | ||
a 4 | ||
b 28 | ||
|
||
-- !query3_0_after -- | ||
a 4 | ||
b 28 | ||
|
||
-- !query4_0_before -- | ||
2024-09-12 8 | ||
2024-09-13 8 | ||
2024-09-14 8 | ||
2024-09-15 8 | ||
|
||
-- !query4_0_after -- | ||
2024-09-12 4 | ||
2024-09-13 8 | ||
2024-09-14 8 | ||
2024-09-15 8 | ||
|
||
-- !query5_0_before -- | ||
2024-09-12 8 | ||
2024-09-13 8 | ||
2024-09-14 8 | ||
2024-09-15 8 | ||
|
||
-- !query5_0_after -- | ||
2024-09-12 8 | ||
2024-09-13 8 | ||
2024-09-14 8 | ||
2024-09-15 8 | ||
|
||
-- !query6_0_before -- | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
|
||
-- !query6_0_after -- | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
|
||
-- !query7_0_before -- | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
|
||
-- !query7_0_after -- | ||
a 1 | ||
a 1 | ||
a 1 | ||
a 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
b 1 | ||
|
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
Oops, something went wrong.