Skip to main content

quad_from_proto_omitting

Function quad_from_proto_omitting 

Source
pub fn quad_from_proto_omitting(
    quad: &EncodedQuad,
    pattern: &EncodedTriplePattern,
    omitted: u8,
) -> Result<EncodedQuad, ProtoError>
Expand description

Decode a quad whose slots may have been omitted, reassembling them exactly.

An omitted slot is never guessed:

  • a slot the request binds falls back to that bound term, so a bind-join probe that pins the subject, or a scan with a constant predicate, gets the real term back without any bytes on the wire;
  • an omitted free slot has no consumer, and reads as the counted-presence sentinel (waratah_storage::ENCODED_TERM_TRUE). That term is already reserved in every query dictionary (TermId::COUNTED_PRESENCE), so interning it cannot invent a data value, and it avoids EncodedTerm::Placeholder, which is neither encodable to nor decodable from the store.

pattern must be the request’s own effective pattern, not the plan-time one: broadcast grounding binds a slot at execution time and the partition omits the slot it was told to.

In debug builds an omitted field is asserted to be empty, so a packer bug surfaces as an assertion rather than as a silently wrong term.