Result shapes#
parcel_runtime::shape applies suppression and aggregate noise to DataFusion plans. Active rules are selected with active_shapes.
apply#
pub fn apply(
plan: LogicalPlan,
optimized: &LogicalPlan,
active: &[&ShapeRule],
) -> parcel_runtime::plan::Result<Shaped>;
Parameter |
Meaning |
|---|---|
|
Caller plan to rewrite. Consumed by this function. |
|
The same plan after optimization, used to identify columns actually read. |
|
Shape rules selected for this caller, potentially from multiple contracts. |
Returns the rewritten plan, privacy-budget charges, and suppression metadata. Unsupported plan shapes or invalid rewrites return RuntimeError.
Shaped#
Field |
Type |
Meaning |
|---|---|---|
|
|
Rewritten plan to execute. |
|
|
Budget charges to apply before execution; the maximum epsilon for each budget. |
|
|
Suppression threshold, if any. |
|
|
Whether the plan contains an aggregate. |
Charge#
Field |
Type |
Meaning |
|---|---|---|
|
|
Name of the privacy budget. |
|
|
Amount charged to that budget. |
apply calculates charges; the application must check and record them before executing the plan.
Suppression and inspection helpers#
Signature |
Parameters and result |
|---|---|
|
Treats all result batches as one group; removes the result when its total row count is below |
|
Rewrites an aggregate plan to suppress groups below |
|
Reports whether a plan contains an aggregate. |
|
Returns column names read by optimized scans. |
After executing Shaped.plan, use suppress_ungrouped when has_aggregate is false and suppress_k is set.