fn encode_retained_conjuncts_to_bytes(
expr: &Arc<dyn PhysicalExpr>,
max_payload_bytes: usize,
retention: ConjunctRetention,
) -> Result<Option<Vec<u8>>, Error>Expand description
Encodes the top-level conjuncts of expr that retention allows to keep.
[split_conjunction] hands out the top-level AND terms of the original
expression; a term is dropped as a whole when its subtree holds a node the retention
cannot ship (see ConjunctRetention). Membership nested inside NOT, CASE or OR
therefore drops that whole conjunct instead of being rewritten in place, so the payload
only ever loses top-level AND terms, which can only widen a predicate.
The retained terms are encoded again under the same max_payload_bytes, so a caller
supplied budget still bounds the frame. Returns Ok(None) when no conjunct can be
retained; the caller decides which typed refusal that is from retention, because an
empty retention caused by an unrepresentable lookup is not the same thing as an empty
retention caused by the budget.