pub fn infer_subquery_relation(
catalog: &dyn SqlCatalog,
alias: &str,
query: &Query,
plan: Option<&SqlPlan>,
functions: &FunctionRegistry,
temporal: TemporalScope,
) -> Result<CollectionInfo>Expand description
The relation a subquery alias exposes.
A synthesized relation carries EngineType::DocumentSchemaless: it is a
MessagePack row stream, and the CTE lowering depends on that. Openness
rides on CollectionInfo::open_schema, not on the engine.
plan is the subqueryâs own plan. The search cells (distance,
_surrogate) are read from it, never re-derived from the AST: the planner
is the only layer that decides whether an operator form routes to a search.
A correlated LATERAL subquery cannot be planned at scope time and carries
no plan: it routes no search cells either (the lateral planner handles its
shapes directly).