[improvement](mtmv) Support grouping_sets rewrite when query rewrite by materialized view#35976
Closed
seawinde wants to merge 4 commits intoapache:masterfrom
Closed
[improvement](mtmv) Support grouping_sets rewrite when query rewrite by materialized view#35976seawinde wants to merge 4 commits intoapache:masterfrom
seawinde wants to merge 4 commits intoapache:masterfrom
Conversation
…he#35723) `If the value of rhs is negative or is not less than the number of bits in lhs, the behavior is undefined.`
…by materialized view
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
Member
Author
|
run buildall |
TPC-H: Total hot run time: 39936 ms |
TPC-DS: Total hot run time: 168980 ms |
ClickBench: Total hot run time: 30.17 s |
morrySnow
reviewed
Jun 7, 2024
| return true; | ||
| } | ||
| // if both query and view has group sets, or query doesn't hava, mv have, not supported | ||
| if ((queryHasGroupSets && viewHasGroupSets) || (!queryHasGroupSets && viewHasGroupSets)) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if ((queryHasGroupSets && viewHasGroupSets) || (!queryHasGroupSets && viewHasGroupSets)) { | |
| if (viewHasGroupSets) { |
Comment on lines
+278
to
+280
| if (!queryHasGroupSets && !viewHasGroupSets) { | ||
| return true; | ||
| } |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
this is replaced by #36056
this depends on #35897
Support grouping_sets, cube, rollup query rewrite by materialized view, if mv group by fields contains all the group by fields in query.
For example as following:
mv def
the query following can rewrite successfully by mv above
if query group by fields is sub of mv group by fields, and the query aggregate function extends
RollupTraitit can also rewrites successfully, for example query as following.
this is applicable for
CUBE,ROLLUP