fv-plan 0.4.0

The FusionVault transform executor on Apache DataFusion: inline row steps and relational reshapes (join, aggregate, window, union) over Arrow, with the value dialect translated into the plan, spatial SQL, file sources, and build orchestration checked against the published conformance vectors.
Documentation
//! Shared DataFusion `SessionContext` factory for pipeline SQL execution.
//!
//! The transform (reshape) context is pre-registered with geodatafusion's spatial functions so
//! pipeline SQL steps run native PostGIS-style `ST_*` — `ST_Contains` / `ST_Distance` / `ST_Area` /
//! `ST_GeomFromText` / `ST_Point` / … — over real geometry (geoarrow), instead of string/GeoJSON
//! juggling. The same registration is reused by the datafusion-postgres serving surface
//! so a PG-wire client sees the identical function catalogue.

use datafusion::prelude::SessionContext;

/// A fresh `SessionContext` with geodatafusion's `ST_*` UDFs registered (measurement, relationships,
/// processing, constructors, WKT/WKB I/O, geohash). Use this anywhere pipeline SQL executes.
pub fn geo_context() -> SessionContext {
    let ctx = SessionContext::new();
    geodatafusion::register(&ctx);
    // server-side series decimation — lttb(ts, value, target) → render-ready points.
    ctx.register_udaf(crate::decimate_udaf::lttb_udaf());
    ctx
}