Documentation
¶
Overview ¶
Package interp is the reference interpreter for the committed read-path subset of the relalg IR. It implements docs/design/ir-semantics.md verbatim and serves as the oracle for the cross-provider differential conformance suite (internal/conformance). It is not a performance reference.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIncomparable = errors.New("interp: incomparable values")
ErrIncomparable is returned when two non-NULL values of incompatible types are compared. The conformance fixture is typed, so this always indicates a corpus or interpreter bug rather than a data condition.
var ErrJoinCardinality = errors.New("interp: a join matched more than one row")
ErrJoinCardinality is returned when a join matches more than one row of its right side, which the IR rules out (it joins on a key).
var ErrUnknownColumn = errors.New("interp: unknown column")
ErrUnknownColumn is returned when an expression references a column the input relation does not have.
var ErrUnknownRelation = errors.New("interp: unknown relation")
ErrUnknownRelation is returned when a Scan references a table not present in the DB.
var ErrUnsupported = errors.New("interp: unsupported expression")
ErrUnsupported is returned for IR nodes outside the committed read-path subset (writes, procedures).
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB maps relation names to tables. Schema qualifiers are ignored: the conformance fixture lives in a single schema.
type Table ¶
Table is an in-memory base relation. Rows hold values in Cols order; cell values are nil, integers, floats, decimal strings are NOT allowed — use int64/float64/string/bool only, with numeric semantics per the spec.
type Verdict ¶ added in v0.1.20
type Verdict int
Verdict is the outcome of checking a predicate against a row of which only some columns are known.
const ( // Fails: the predicate is FALSE or UNKNOWN whatever the other columns // hold, so the row does not satisfy it. Fails Verdict = iota // Holds: the predicate is TRUE whatever the other columns hold. Holds // Depends: the outcome depends on columns that are not known; the // residual predicate says how. Depends )
func Check ¶ added in v0.1.20
Check evaluates p against a row whose known columns are given (a nil value is NULL), with the semantics of docs/design/ir-semantics.md. The conditions on known columns are decided; the rest of p is returned as the residual when the verdict is Depends. A predicate the check cannot decide exactly (EXISTS, incomparable values, NULL beside unknown columns) Fails, with the reason as the error: the caller refuses the row.