-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](mtmv) Fix rewrite fail when join conjuncts eliminate and group by key eliminate both happened #55674
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
[fix](mtmv) Fix rewrite fail when join conjuncts eliminate and group by key eliminate both happened #55674
Changes from all commits
37d7061
ccc5da2
e8a228e
789398c
525ab8e
fe1d936
650e487
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,8 +228,6 @@ public class Rewriter extends AbstractBatchJobExecutor { | |
| // so there may be two filters we need to merge them | ||
| new MergeFilters() | ||
| ), | ||
| custom(RuleType.AGG_SCALAR_SUBQUERY_TO_WINDOW_FUNCTION, | ||
| AggScalarSubQueryToWindowFunction::new), | ||
| bottomUp( | ||
| new EliminateUselessPlanUnderApply(), | ||
| // CorrelateApplyToUnCorrelateApply and ApplyToJoin | ||
|
|
@@ -244,13 +242,7 @@ public class Rewriter extends AbstractBatchJobExecutor { | |
| * we expected. | ||
| */ | ||
| new CorrelateApplyToUnCorrelateApply(), | ||
| new ApplyToJoin(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The NormalizeAggregaterule following ApplyToJoinhas been removed. This aligns with the usage of RBO rules in the main workflow, primarily for performance optimization. The NormalizeAggregateoperation will now be performed uniformly in a separate subsequent stage. |
||
| // UnCorrelatedApplyAggregateFilter rule will create new aggregate outputs, | ||
| // The later rule CheckPrivileges which inherent from ColumnPruning | ||
| // only works | ||
| // if the aggregation node is normalized, so we need call | ||
| // NormalizeAggregate here | ||
| new NormalizeAggregate() | ||
| new ApplyToJoin() | ||
| ) | ||
| ), | ||
| // before `Subquery unnesting` topic, some correlate slots should have appeared at | ||
|
|
@@ -409,7 +401,6 @@ public class Rewriter extends AbstractBatchJobExecutor { | |
| custom(RuleType.ADJUST_NULLABLE, () -> new AdjustNullable(false)) | ||
| ), | ||
| topic("add projection for join", | ||
| // this is for hint project join rewrite rule | ||
| custom(RuleType.ADD_PROJECT_FOR_JOIN, AddProjectForJoin::new), | ||
| topDown(new MergeProjectable()) | ||
| ) | ||
|
|
||
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.
why remove this?
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.
The rule AGG_SCALAR_SUBQUERY_TO_WINDOW_FUNCTION generates window functions. Since the current code does not support window function rewriting, it would cause the transparent query rewrite using materialized views to fail. Therefore, this rule has been disabled in the rule package used for transparent query rewriting.