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.

@FunctionalInterface public interface GeneratorCatalog
Supplies the schema of a generator source during semantic analysis — the seam through which the analyzer learns a generator's heading without the script declaring it (generator-owned schema).

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 Details

    • NONE

      static final GeneratorCatalog NONE
      A catalog that knows no generators — the default for analysis without a registry.
  • Method Details

    • generatorSchema

      Optional<Schema> generatorSchema(String name, Map<String,String> args)
      Returns the schema of the named generator for the given arguments, or Optional.empty() if the generator is unknown.
      Parameters:
      name - the generator name (e.g. "Range"); case-insensitive
      args - the raw generator arguments
      Returns:
      the generator's output schema, or empty if unknown
    • generatorCardinality

      default OptionalLong generatorCardinality(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. Range) has an exact row count. Returns OptionalLong.empty() for an unknown generator or an unbounded/unknown cardinality; the default is empty.
      Parameters:
      name - the generator name; case-insensitive
      args - the raw generator arguments
      Returns:
      the exact row count, or empty
    • generatorBoundedness

      default Boundedness generatorBoundedness(String name, Map<String,String> args)
      Whether the named generator is finite, for the given arguments — the leaf half of relix.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 as BOUNDED rather 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-insensitive
      args - the raw generator arguments
      Returns:
      its boundedness, or Boundedness.UNKNOWN for a generator this catalog does not know