MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / plan_as_of

Function plan_as_of

src/sql/src/plan/query.rs:1004–1015  ·  view source on GitHub ↗

Plans an expression in the AS OF position of a `SELECT` or `SUBSCRIBE`, or `CREATE MATERIALIZED VIEW` statement.

(
    scx: &StatementContext,
    as_of: Option<AsOf<Aug>>,
)

Source from the content-addressed store, hash-verified

1002/// Plans an expression in the AS OF position of a `SELECT` or `SUBSCRIBE`, or `CREATE MATERIALIZED
1003/// VIEW` statement.
1004pub fn plan_as_of(
1005 scx: &StatementContext,
1006 as_of: Option<AsOf<Aug>>,
1007) -> Result<QueryWhen, PlanError> {
1008 match as_of {
1009 None => Ok(QueryWhen::Immediately),
1010 Some(as_of) => match as_of {
1011 AsOf::At(expr) => Ok(QueryWhen::AtTimestamp(plan_as_of_or_up_to(scx, expr)?)),
1012 AsOf::AtLeast(expr) => Ok(QueryWhen::AtLeastTimestamp(plan_as_of_or_up_to(scx, expr)?)),
1013 },
1014 }
1015}
1016
1017/// Plans and evaluates a scalar expression in a OneShot context to a non-null MzTimestamp.
1018///

Callers 3

plan_select_innerFunction · 0.85
plan_explain_timestampFunction · 0.85
plan_subscribeFunction · 0.85

Calls 1

plan_as_of_or_up_toFunction · 0.85

Tested by

no test coverage detected