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
//! Ordered pipeline rows. Column order is significant (it becomes the output schema), so a row is an
//! ordered list of (name, value) — not a sorted map. Values are `fv_value::Value`.

use fv_value::{Scope, Value};

/// One pipeline row, preserving column order (unlike a sorted map).
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Row(pub Vec<(String, Value)>);

impl Row {
    pub fn new() -> Self {
        Row(Vec::new())
    }

    pub fn get(&self, key: &str) -> Value {
        self.0
            .iter()
            .find(|(k, _)| k == key)
            .map(|(_, v)| v.clone())
            .unwrap_or(Value::Null)
    }

    pub fn contains(&self, key: &str) -> bool {
        self.0.iter().any(|(k, _)| k == key)
    }

    /// Set a key: overwrite in place if present (preserving position), else append.
    pub fn set(&mut self, key: &str, value: Value) {
        if let Some(slot) = self.0.iter_mut().find(|(k, _)| k == key) {
            slot.1 = value;
        } else {
            self.0.push((key.to_string(), value));
        }
    }

    pub fn columns(&self) -> Vec<String> {
        self.0.iter().map(|(k, _)| k.clone()).collect()
    }

    /// A lookup scope for the value dialect (order irrelevant for evaluation). Prefer
    /// [`lookup`](Self::lookup) on the hot path — it evaluates directly against the row with no map
    /// build (T3).
    pub fn scope(&self) -> Scope {
        self.0.iter().cloned().collect()
    }

    /// The row as a zero-copy [`fv_value::Lookup`] — evaluate an expression against it without
    /// building a `Scope` per row (the T0-measured 211ns/row saved on filter/applyExpression).
    pub fn lookup(&self) -> &[(String, Value)] {
        &self.0
    }
}