Skip to main content

Module proto

Module proto 

Source
Expand description

Decode the structured row-pattern proto into the executor-side Pattern. The frontend lowers the SQL PATTERN clause directly into this proto tree, so there is no textual round-trip.

Constants§

MAX_PATTERN_NFA_STATES 🔒
Decode-side re-statement of the binder’s MAX_PATTERN_NFA_STATES.
MAX_PERMUTE_VARS 🔒
Decode-side re-statement of the binder’s MAX_PERMUTE_VARS: PERMUTE expands to n! orderings, so a skewed or corrupt plan carrying an oversized one would allocate factorially before any row is processed. Every other malformed input to this decoder fails with a descriptive error; the sizes must too.
MAX_QUANTIFIER_BOUND 🔒
Decode-side re-statement of the binder’s MAX_QUANTIFIER_BOUND: a range bound is a state multiplier for the compiled NFA (a{4_000_000_000} would try to build billions of states).

Functions§

decode_pattern 🔒
estimate_nfa_states 🔒
Estimated compiled-NFA state count, mirroring the binder’s estimate_nfa_states over the decoded pattern. Saturating throughout: the point is to reject the absurd, and a saturated total is still over the cap. PERMUTE is counted in its expanded form (n! orderings), the same shape the binder assumes.
pattern_from_protobuf
Build a Pattern from its protobuf representation, rejecting one whose compiled size would be absurd. The size check is on the whole decoded pattern, since nesting is what defeats the per-construct caps.
patterns_from_protobuf 🔒
quantifier_from_protobuf 🔒