Skip to content
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

[Refactor] Refactor Optimizer&OptimizerContext interface #55117

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Seaven
Copy link
Contributor

@Seaven Seaven commented Jan 15, 2025

Why I'm doing:

What I'm doing:

to simpifiy Optimizer/OptimizerContext interface
none logical update

Rename:

  • Optimizer to QueryOptimizer
  • OptimizerConfig to OptimizerOptions

Add:

  • Optimizer Interface
  • OptimizerFactory to manage Optimizer create

Refactor:

  • Optimizer constructor, only depends on OptimizerContext

  • OptimizerContext variables

  • split ShortCircuitOptimizer from QueryOptimizer

  • update UT interface

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.4
    • 3.3
    • 3.2
    • 3.1
    • 3.0

@Seaven Seaven requested review from a team as code owners January 15, 2025 12:23
@mergify mergify bot assigned Seaven Jan 15, 2025
Signed-off-by: Seaven <[email protected]>
Signed-off-by: Seaven <[email protected]>
Signed-off-by: Seaven <[email protected]>
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

pass : 627 / 647 (96.91%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/authorization/ColumnPrivilege.java 0 8 00.00% [114, 115, 116, 117, 118, 119, 120, 121]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/MvRewriteStrategy.java 3 4 75.00% [88]
🔵 com/starrocks/sql/optimizer/OptimizerFactory.java 17 18 94.44% [21]
🔵 com/starrocks/sql/optimizer/QueryOptimizer.java 426 435 97.93% [705, 706, 776, 831, 905, 921, 922, 953, 954]
🔵 com/starrocks/sql/optimizer/OptimizerContext.java 55 56 98.21% [111]
🔵 com/starrocks/sql/optimizer/MvRewritePreprocessor.java 2 2 100.00% []
🔵 com/starrocks/sql/optimizer/task/RewriteTreeTask.java 1 1 100.00% []
🔵 com/starrocks/sql/optimizer/task/OptimizerTask.java 2 2 100.00% []
🔵 com/starrocks/sql/optimizer/task/TaskScheduler.java 1 1 100.00% []
🔵 com/starrocks/sql/DeletePlanner.java 2 2 100.00% []
🔵 com/starrocks/sql/UpdatePlanner.java 3 3 100.00% []
🔵 com/starrocks/sql/plan/ExecPlan.java 5 5 100.00% []
🔵 com/starrocks/sql/optimizer/MaterializedViewOptimizer.java 12 12 100.00% []
🔵 com/starrocks/sql/InsertPlanner.java 2 2 100.00% []
🔵 com/starrocks/sql/analyzer/MaterializedViewAnalyzer.java 3 3 100.00% []
🔵 com/starrocks/sql/optimizer/Optimizer.java 3 3 100.00% []
🔵 com/starrocks/sql/ShortCircuitPlanner.java 2 2 100.00% []
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/rule/TextMatchBasedRewriteRule.java 1 1 100.00% []
🔵 com/starrocks/sql/optimizer/validate/MVRewriteValidator.java 4 4 100.00% []
🔵 com/starrocks/sql/plan/PlanFragmentBuilder.java 7 7 100.00% []
🔵 com/starrocks/sql/optimizer/ShortCircuitOptimizer.java 19 19 100.00% []
🔵 com/starrocks/sql/optimizer/OptimizerOptions.java 20 20 100.00% []
🔵 com/starrocks/sql/optimizer/dump/QueryDumpInfo.java 1 1 100.00% []
🔵 com/starrocks/sql/StatementPlanner.java 24 24 100.00% []
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/MvUtils.java 10 10 100.00% []
🔵 com/starrocks/sql/analyzer/AnalyzeStmtAnalyzer.java 1 1 100.00% []
🔵 com/starrocks/sql/optimizer/rule/transformation/PruneProjectColumnsRule.java 1 1 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant