1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Compaction module for Iceberg tables
//!
//! This module provides bin-pack compaction for Iceberg tables. Compaction
//! merges small files into larger ones to improve query performance and
//! reduce metadata overhead.
//!
//! # Example
//!
//! ```no_run
//! use icepick::compact::{CompactOptions, CompactionPlan, execute_compaction};
//! use icepick::catalog::Catalog;
//!
//! # async fn example(table: &icepick::Table, catalog: &dyn Catalog) -> Result<(), Box<dyn std::error::Error>> {
//! // Create compaction options
//! let options = CompactOptions::new()
//! .with_target_file_size(256 * 1024 * 1024)? // 256 MB
//! .with_min_files_per_group(3)?;
//!
//! // Create a compaction plan
//! let plan = CompactionPlan::create(table, &options).await?;
//!
//! if !plan.is_empty() {
//! println!("Found {} partitions to compact", plan.partition_count());
//!
//! // Execute the plan
//! let result = execute_compaction(plan, table, catalog, &options).await?;
//! println!("Compacted {} files into {}", result.files_removed, result.files_added);
//! }
//! # Ok(())
//! # }
//! ```
pub use ;
pub use CompactOptions;
pub use ;
use crateCatalog;
use crateResult;
use crateTable;
/// Plan compaction for a table (does not execute)
pub async
/// Execute compaction on a table
///
/// This is a convenience function that creates a plan and executes it.
pub async