Skip to main content

Module array_fn

Module array_fn 

Source
Expand description

Planner for ARRAY_* table-valued / scalar functions.

The functions live in two AST shapes:

  • Read (ARRAY_SLICE, ARRAY_PROJECT, ARRAY_AGG, ARRAY_ELEMENTWISE) — SELECT * FROM array_xxx(...). Parsed by sqlparser as TableFactor::Table { name, args: Some(_), .. } (Postgres-style table-valued function). try_plan_array_table_fn intercepts these before catalog resolution.
  • Maintenance (ARRAY_FLUSH, ARRAY_COMPACT) — bare SELECT array_flush(name) with no FROM clause. try_plan_array_maint_fn intercepts these from the constant- query path.

Functions§

try_plan_array_maint_fn
Try to intercept a no-FROM SELECT array_flush(name) / SELECT array_compact(name). The single projection item must be a bare function call carrying one string-literal argument.
try_plan_array_table_fn
Try to intercept a SELECT * FROM array_xxx(...) table-valued function call. Returns Ok(Some(plan)) on a match, Ok(None) if the FROM is not an array function (caller falls through to normal catalog resolution).