Function mz_persist_types::stats::trim_to_budget

source ·
pub fn trim_to_budget(
    stats: &mut ProtoStructStats,
    budget: usize,
    force_keep_col: impl Fn(&str) -> bool
) -> usize
Expand description

Trims the included column status until they fit within a budget.

This might remove stats for a column entirely, unless force_keep_col returns true for that column. The resulting StructStats object is guaranteed to fit within the passed budget, except when the columns that are force-kept are collectively larger than the budget.

The number of bytes trimmed is returned.