Skip to content

[Enhancement] support iceberg rewrite manifests procedure (backport #68817)#69015

Open
mergify[bot] wants to merge 1 commit intobranch-4.1from
mergify/bp/branch-4.1/pr-68817
Open

[Enhancement] support iceberg rewrite manifests procedure (backport #68817)#69015
mergify[bot] wants to merge 1 commit intobranch-4.1from
mergify/bp/branch-4.1/pr-68817

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Feb 6, 2026

Why I'm doing:

Iceberg tables can accumulate many small manifest files over time due to frequent commits and rewrites. This increases metadata size, slows down metadata reads and query planning, and can affect overall query performance. Apache Iceberg provides a rewrite_manifests operation to compact and reorganize these manifests, but StarRocks’ Iceberg integration did not expose it. This PR adds support so users can maintain Iceberg table metadata (compact manifests) directly from StarRocks.

What I'm doing:

  • Rewrite Manifests

    • New procedure rewrite_manifests() (no arguments): rewrites current snapshot’s manifest files by clustering by partition (for better read locality), respects commit.manifest.target-size-bytes, and caps the number of manifest clusters to avoid OOM.
    • Registered in IcebergTable / IcebergTableOperation and wired to ALTER TABLE ... EXECUTE rewrite_manifests().
  • Tests

    • Add/update unit tests for the new procedures (e.g.RewriteManifestsProcedureTest) and for AlterTableOperationStmt (e.g. rewrite_manifests parsing).
    • Add a dedicated SQL integration test test_iceberg_rewrite_manifests that creates an Iceberg table, inserts data, runs rewrite_data_files() and rewrite_manifests(), and checks manifest counts via $manifests.

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 pr needs auto generate documentation
  • 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
    • 4.1
    • 4.0
    • 3.5
    • 3.4

This is an automatic backport of pull request #68817 done by [Mergify](https://mergify.com).

Signed-off-by: dontknow9179 <clin56322@gmail.com>
(cherry picked from commit 56f6a7f)
@mergify
Copy link
Contributor Author

mergify bot commented Feb 6, 2026

🧪 CI Insights

Here's what we observed from your CI run for a2e260f.

🟢 All jobs passed!

But CI Insights is watching 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant