java.lang.Object
com.darkcollective.relix.semantic.internal.RelAlgebraValidator
All Implemented Interfaces:
RelNodeVisitor<Void>

public final class RelAlgebraValidator extends Object implements RelNodeVisitor<Void>
Validates structural and semantic constraints over a single relational algebra expression tree.

This visitor runs after schema inference, consuming the already-populated SchemaAnnotations map rather than re-deriving schemas. Nodes that were left unannotated (because inference failed) are silently skipped — the upstream inference error is sufficient.

Checks performed

Set operations (∪ ⊎ ∩ −)
Both operands must have the same column count; columns at matching positions must have compatible types (ScalarType.ANY is compatible with any type).
Division (÷)
Every column in the right (divisor) schema must appear, by name, in the left (dividend) schema.
Projection (π)
AttributeOperand references in projected expressions must resolve to a column in the input schema (after stripping any qualifier). FunctionCall references are validated for existence and arity against the symbol table.
Aggregation (γ)
Group-by attribute names and aggregate function attribute names must all resolve in the input schema.
Sort (τ)
Sort specification attribute names must resolve in the input schema.

All errors are appended to the mutable errors list supplied at construction time; the visitor never throws.