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 mv partition compensate #54387

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LiShuMing
Copy link
Contributor

@LiShuMing LiShuMing commented Dec 26, 2024

Why I'm doing:

What I'm doing:

Refactor mv partition compensation:

  1. rename BaseCompensation to TableCompensation which specifics MV's ref-base-table's compensate.
  2. Implement Olap/External table compensations for TableCompensation which use unrefreshed partition ids/keys to deduce partition compensations, and later we can extends to PartitionRetentionTableCompensation which is generated by mv's partition_retention_condition.(see: [Enhancement] [WIP] Support partition retention condition compensation in force_mv rewrite mode #54072)
  3. Split MVCompensationBuilder into Olap/External table compensations.

Fixes #53117

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

@LiShuMing LiShuMing requested review from a team as code owners December 26, 2024 08:29
@LiShuMing LiShuMing force-pushed the refactor_mv_compensation_v1 branch from 47f9187 to bbc9a44 Compare December 26, 2024 08:38
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

fail : 315 / 419 (75.18%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/catalog/mv/MVTimelinessListPartitionArbiter.java 1 4 25.00% [63, 75, 84]
🔵 com/starrocks/catalog/mv/MVTimelinessArbiter.java 2 7 28.57% [265, 337, 342, 353, 365]
🔵 com/starrocks/catalog/mv/MVTimelinessRangePartitionArbiter.java 1 3 33.33% [72, 90]
🔵 com/starrocks/catalog/MvUpdateInfo.java 14 33 42.42% [73, 143, 146, 147, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 161, 162, 163, 164]
🔵 com/starrocks/scheduler/persist/MVTaskRunExtraMessage.java 2 3 66.67% [106]
🔵 com/starrocks/catalog/MvBaseTableUpdateInfo.java 4 6 66.67% [89, 102]
🔵 com/starrocks/catalog/MvRefreshArbiter.java 3 4 75.00% [92]
🔵 com/starrocks/sql/optimizer/rule/transformation/MaterializedViewTransparentRewriteRule.java 3 4 75.00% [204]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/compensation/ExternalTableCompensation.java 150 191 78.53% [102, 118, 144, 204, 205, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 220, 221, 222, 231, 232, 233, 236, 237, 238, 276, 294, 295, 296, 297, 319, 320, 333, 334, 335, 340, 341, 345, 346, 347]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/compensation/OlapTableCompensation.java 37 47 78.72% [46, 68, 69, 71, 72, 73, 74, 83, 84, 85]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/compensation/TableCompensation.java 18 23 78.26% [61, 66, 102, 106, 108]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/compensation/MVCompensation.java 23 28 82.14% [56, 59, 143, 144, 145]
🔵 com/starrocks/catalog/mv/MVTimelinessNonPartitionArbiter.java 5 6 83.33% [95]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/compensation/MVCompensationBuilder.java 32 38 84.21% [71, 93, 108, 110, 142, 143]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/MvPartitionCompensator.java 6 7 85.71% [140]
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/compensation/OptCompensator.java 9 10 90.00% [56]
🔵 com/starrocks/sql/optimizer/MvRewritePreprocessor.java 2 2 100.00% []
🔵 com/starrocks/sql/optimizer/rule/transformation/materialization/MVTransparentState.java 1 1 100.00% []
🔵 com/starrocks/sql/optimizer/rule/transformation/ListPartitionPruner.java 2 2 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.

[Feature] Support TTL for List Partition Tables and Materialized Views
2 participants