Skip to content

HIVE-29788: Support for rewrite_manifests iceberg procedure - #6667

Open
Aggarwal-Raghav wants to merge 1 commit into
apache:masterfrom
Aggarwal-Raghav:HIVE-29788
Open

HIVE-29788: Support for rewrite_manifests iceberg procedure#6667
Aggarwal-Raghav wants to merge 1 commit into
apache:masterfrom
Aggarwal-Raghav:HIVE-29788

Conversation

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add support for the Iceberg REWRITE_MANIFESTS procedure in Hive https://iceberg.apache.org/docs/latest/spark-procedures/#rewrite_manifests
The implementation is very similar to Trino's approach https://github.com/trinodb/trino/blob/master/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/OptimizeManifests.java

Why are the changes needed?

Optimize manifest files using hive engine rather than running spark sql CALL spark_catalog.system.rewrite_manifests(...). Also, hive EXPIRE_SNAPSHOTS or OPTIMIZE TABLE doesn't clean up manifest files.

Does this PR introduce any user-facing change?

Yes. A new SQL command is now available for Hive-Iceberg users:
ALTER TABLE <table> EXECUTE REWRITE_MANIFESTS

How was this patch tested?

Using UT. Added testRewriteManifests and testRewriteManifestsPartitioned in TestHiveIcebergSnapshotOperations

@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

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.

2 participants