pub struct TableRef {
pub name: String,
pub alias: Option<String>,
pub as_of_segment: Option<u32>,
pub unnest_expr: Option<Box<Expr>>,
pub unnest_column_aliases: Vec<String>,
pub generate_series_args: Option<Vec<Expr>>,
pub lateral_subquery: Option<Box<SelectStatement>>,
}Fields§
§name: String§alias: Option<String>§as_of_segment: Option<u32>v6.10.2 — AS OF SEGMENT '<id>' cold-tier time-travel.
When Some(id), the scan restricts to rows that live in
segment <id> only — useful for forensic inspection of a
specific freezer-emitted segment without exposing the hot
tier. AS OF TIMESTAMP <ts> (PG-flavoured time travel)
is STABILITY carve-out for v6.10 — needs the freezer to
stamp each segment with a wall-clock at creation time.
unnest_expr: Option<Box<Expr>>v7.11.7 — FROM unnest(<expr>) [AS] <alias> set-returning
source. When Some, name is the alias (defaulting to
"unnest" when no AS is given) and the engine builds a
synthetic single-column table by evaluating the expression
once at SELECT entry. Each TEXT[] element becomes one row;
NULL elements become NULL cells. v7.11 supported
uncorrelated UNNEST only as the FROM primary; v7.13.2
(mailrs round-6 S5) widens to UNNEST in any FROM-list
position (cross-join with regular tables).
unnest_column_aliases: Vec<String>v7.13.2 — mailrs round-6 S5. PG-standard
UNNEST(<arr>) AS alias(col_name) column-list aliasing:
when non-empty, the first entry overrides the projected
column name for the unnested column. Empty = fall back to
the table alias (pre-v7.13.2 behaviour).
generate_series_args: Option<Vec<Expr>>v7.17.0 Phase 3.10 — FROM generate_series(start, stop [, step]) set-returning source. When Some, the engine
materialises a single-column virtual table by stepping
start to stop inclusive. Args are the literal arg list
(2 for default-step, 3 for explicit-step). Supports:
- SmallInt / Int / BigInt with integer step (default = 1)
- Timestamp with INTERVAL step (PG date-range pattern)
Mutually exclusive with
unnest_expr— both populate the same downstream dispatch slot.namedefaults to"generate_series"when no alias is provided.
lateral_subquery: Option<Box<SelectStatement>>v7.17.0 Phase 3.P0-41 — LATERAL ( SELECT … ) derived
table. When Some, the TableRef is a parenthesised SELECT
that may reference columns from the preceding FROM items
(correlated derived table). The executor materialises the
subquery per left-row, substituting outer-column references
against the current join row’s values before running the
inner SELECT, then cross-joins the result back.
Mutually exclusive with name / unnest_expr /
generate_series_args.