Interface GeneratorCatalog
- All Known Implementing Classes:
GeneratorRegistry
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
It mirrors CatalogProvider: a generator's rows are produced in
relix-processor (they need Row, which sits above this module), so
the schema is resolved through this thin seam, implemented by the processor's
generator registry and injected into SemanticAnalyzer. The default
NONE resolves nothing — a generator source then produces a clear
"unknown generator" error in contexts where no registry is wired.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GeneratorCatalogA catalog that knows no generators — the default for analysis without a registry. -
Method Summary
Modifier and TypeMethodDescriptiondefault BoundednessgeneratorBoundedness(String name, Map<String, String> args) Whether the named generator is finite, for the given arguments — the leaf half ofrelix.relations.boundedness, and the one half no analysis can derive.default OptionalLonggeneratorCardinality(String name, Map<String, String> args) The exact cardinality of the named generator for the given arguments, when known — fed to the cost model so a finite generator (e.g.generatorSchema(String name, Map<String, String> args) Returns the schema of the named generator for the given arguments, orOptional.empty()if the generator is unknown.
-
Field Details
-
NONE
A catalog that knows no generators — the default for analysis without a registry.
-
-
Method Details
-
generatorSchema
Returns the schema of the named generator for the given arguments, orOptional.empty()if the generator is unknown.- Parameters:
name- the generator name (e.g."Range"); case-insensitiveargs- the raw generator arguments- Returns:
- the generator's output schema, or empty if unknown
-
generatorCardinality
The exact cardinality of the named generator for the given arguments, when known — fed to the cost model so a finite generator (e.g.Range) has an exact row count. ReturnsOptionalLong.empty()for an unknown generator or an unbounded/unknown cardinality; the default is empty.- Parameters:
name- the generator name; case-insensitiveargs- the raw generator arguments- Returns:
- the exact row count, or empty
-
generatorBoundedness
Whether the named generator is finite, for the given arguments — the leaf half ofrelix.relations.boundedness, and the one half no analysis can derive.It rides this seam for the reason
generatorCardinality(java.lang.String, java.util.Map<java.lang.String, java.lang.String>)does: a generator's finiteness is declared by the generator, which lives above this module, and the registry that produces its rows is the same object that answers here — so the two halves of the pipeline cannot disagree about which relations are infinite.The default is
Boundedness.UNKNOWN, which is what a catalog that knows no generators honestly has to say. That is not the conservatism the planner wants: a check that refuses an unbounded input reads an unrecognised leaf asBOUNDEDrather than risk rejecting a legal query, while a catalog reporting a fact about a generator it has never heard of would simply be making it up.- Parameters:
name- the generator name; case-insensitiveargs- the raw generator arguments- Returns:
- its boundedness, or
Boundedness.UNKNOWNfor a generator this catalog does not know
-