-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feature](mtmv) Support querying rewrite by materialized view when DML such as insert and insert overwrite #37561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
2 similar comments
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 40869 ms |
TPC-DS: Total hot run time: 175187 ms |
ClickBench: Total hot run time: 30.38 s |
zfr9527
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by anyone and no changes requested. |
|
run buildall |
TPC-H: Total hot run time: 40186 ms |
TPC-DS: Total hot run time: 172714 ms |
ClickBench: Total hot run time: 30.31 s |
46f9756 to
d0e868c
Compare
|
run buildall |
TPC-H: Total hot run time: 39985 ms |
TPC-DS: Total hot run time: 171118 ms |
ClickBench: Total hot run time: 30.77 s |
|
run buildall |
TPC-H: Total hot run time: 39725 ms |
TPC-DS: Total hot run time: 174677 ms |
ClickBench: Total hot run time: 30.71 s |
fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupExpressionJob.java
Show resolved
Hide resolved
.../org/apache/doris/nereids/rules/exploration/mv/InitConsistentMaterializationContextHook.java
Show resolved
Hide resolved
|
run buildall |
TPC-H: Total hot run time: 40142 ms |
TPC-DS: Total hot run time: 174149 ms |
ClickBench: Total hot run time: 30.7 s |
|
run buildall |
TPC-H: Total hot run time: 40096 ms |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 39702 ms |
TPC-DS: Total hot run time: 173964 ms |
ClickBench: Total hot run time: 31.09 s |
| LOG.debug("Start analyze plan"); | ||
| } | ||
| keepOrShowPlanProcess(showPlanProcess, () -> cascadesContext.newAnalyzer().analyze()); | ||
| if (this.cascadesContext.getConnectContext().getSessionVariable().isEnableDmlMaterializedViewRewrite() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u should add a analysis rule and check do this in rule. move hooks from NereidsPlanner into StatementContext
| = "enable_dml_materialized_view_rewrite"; | ||
|
|
||
| public static final String ENABLE_DML_MATERIALIZED_VIEW_REWRITE_WHEN_BASE_TABLE_UNAWARENESS | ||
| = "enable_dml_materialized_view_rewrite_when_base_table_unawareness"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unawareness? is it a standard phrases?
|
run buildall |
TPC-H: Total hot run time: 39975 ms |
TPC-DS: Total hot run time: 172991 ms |
ClickBench: Total hot run time: 30.88 s |
|
run buildall |
TPC-H: Total hot run time: 39795 ms |
TPC-DS: Total hot run time: 174140 ms |
ClickBench: Total hot run time: 30.64 s |
|
PR approved by at least one committer and no changes requested. |
| @Override | ||
| public List<Rule> buildRules() { | ||
| return ImmutableList.of( | ||
| RuleType.INIT_MATERIALIZATION_HOOK_FOR_FILE_SINK.build(logicalFileSink() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use any().when(LogicalTableSink.class::isInstanceOf)
…sert and insert overwrite dml
ac8d705 to
ad9f822
Compare
|
this is replaced by #38115, this branch rebase wrongly, it doesn't modify the meta etc |
Proposed changes
Support querying rewrite by materialized view when DML such as insert and insert overwrite , into outfile etc.
this is default enable, you can disable it by
set enable_dml_materialized_view_rewrite = falseand the
enable_materialized_view_rewriteis only control DQL.It would not rewrite by materialized view when query sql use external table.
If you want rewrite by materialized view when use external table in DML,
you should
set enable_dml_materialized_view_rewrite_when_base_table_unawareness = true;this is default false.
this pr is replaced by #38115