Interface SymbolTable
- All Known Implementing Classes:
InMemorySymbolTable
Symbol instances.
The table supports two categories of symbol:
- Relations — looked up by
(namespace, name). - Functions — looked up by
(namespace, name, parameterSignature), supporting overload resolution.
All name comparisons are case-insensitive.
Lookup order
The single-argument lookup overloads search the "default" namespace
first, then the "builtin" namespace. Use the two-argument overloads
to target a specific namespace directly.
Registration
register(Symbol) always returns a RegistrationResult; it
never throws on conflict. Inspect the result to determine whether the symbol
was accepted, replaced with a warning, or rejected.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a snapshot of all symbols currently registered in the table, in registration order.lookupFunction(String name) Returns all overloads of the function with the givennamefrom the"default"namespace, then the"builtin"namespace.lookupFunction(String namespace, String name) Returns all overloads of the function with the givennamein the specifiednamespace.lookupFunction(String name, List<ScalarType> paramTypes) Returns the unique overload of the function namednamewhose parameter signature exactly matchesparamTypes, searching"default"then"builtin".lookupRelation(String name) Returns the relation with the givennamefrom the"default"namespace, or — if not found there — from the"builtin"namespace.lookupRelation(String namespace, String name) Returns the relation with the givennamein the specifiednamespace.Attempts to registersymbolin the table.default List<FunctionSymbol> resolveFunction(String name) Resolves a (possibly dotted) table-valued-function reference to its overloads, mirroringresolveRelation(String)for relations.default Optional<RelationSymbol> resolveRelation(String name) Resolves a relation reference that may be either a flat name or a dotted"namespace.relation"reference.
-
Method Details
-
register
Attempts to registersymbolin the table.If a symbol with the same namespace and canonical name (and, for functions, the same parameter signature) already exists, the existing symbol's
ShadowPolicygoverns the outcome.- Parameters:
symbol- the symbol to register; must not be null- Returns:
- a result describing whether the symbol was accepted, warned, or rejected
-
lookupRelation
Returns the relation with the givennamefrom the"default"namespace, or — if not found there — from the"builtin"namespace.- Parameters:
name- the relation name (case-insensitive)- Returns:
- the matching relation symbol, or empty if none found
-
lookupRelation
Returns the relation with the givennamein the specifiednamespace.- Parameters:
namespace- the target namespace (case-insensitive)name- the relation name (case-insensitive)- Returns:
- the matching relation symbol, or empty if none found
-
resolveRelation
Resolves a relation reference that may be either a flat name or a dotted"namespace.relation"reference.A dotted name like
"relix.relations"or"conn.orders"is first tried as a namespace-qualified lookup (relationrelationsin namespacerelix); if that misses, it falls back to the flatlookupRelation(String)(which also covers connection-table symbols registered under their full dotted name). A name with no dot uses the flat lookup directly.This is the single resolution entry point shared by schema inference and physical planning so that a reference resolves identically in both phases.
- Parameters:
name- the relation reference (flat or dotted; case-insensitive)- Returns:
- the matching relation symbol, or empty if none found
-
lookupFunction
Returns all overloads of the function with the givennamefrom the"default"namespace, then the"builtin"namespace.- Parameters:
name- the function name (case-insensitive)- Returns:
- all matching function symbols; never null, may be empty
-
resolveFunction
Resolves a (possibly dotted) table-valued-function reference to its overloads, mirroringresolveRelation(String)for relations.A dotted name like
"relix.impact"is first tried as a namespace-qualified lookup (functionimpactin namespacerelix); if that misses, it falls back to the flatlookupFunction(String). A name with no dot uses the flat lookup directly. This is the single resolution entry point shared by schema inference, validation, and physical planning, so a table-valued-function call resolves identically in every phase — and lets the shipped introspection stdlib live in the reservedrelixnamespace (e.g.relix.impact(r)).- Parameters:
name- the function reference (flat or dotted; case-insensitive)- Returns:
- the matching function overloads; never null, may be empty
-
lookupFunction
Returns all overloads of the function with the givennamein the specifiednamespace.- Parameters:
namespace- the target namespace (case-insensitive)name- the function name (case-insensitive)- Returns:
- all matching function symbols; never null, may be empty
-
lookupFunction
Returns the unique overload of the function namednamewhose parameter signature exactly matchesparamTypes, searching"default"then"builtin".- Parameters:
name- the function name (case-insensitive)paramTypes- the ordered list of argument types to match- Returns:
- the matching overload, or empty if no exact match exists
-
allSymbols
Collection<Symbol> allSymbols()Returns a snapshot of all symbols currently registered in the table, in registration order.- Returns:
- an unmodifiable collection of all symbols; never null
-