Skip to main content

linkrs_query/executor/streaming/operators/spec/
apply.rs

1//! Immutable configuration for apply operators.
2
3use std::sync::Arc;
4
5use crate::executor::streaming::plan::types::PhysicalPlan;
6use linkrs_core::types::expr::Expression;
7
8/// Immutable config for apply operators.
9#[derive(Debug, Clone)]
10pub enum ApplySpec {
11    Apply {
12        kind: ApplyKind,
13        correlated_columns: Vec<String>,
14    },
15    PatternApply {
16        hash_keys: Vec<Expression>,
17        probe_keys: Vec<Expression>,
18        anti: bool,
19    },
20    CorrelatedApply {
21        /// Self-contained right subtree (rooted at an `Argument` source),
22        /// re-executed once per outer row with the outer row bound as the
23        /// correlation frame.
24        sub_plan: Arc<PhysicalPlan>,
25        anti: bool,
26    },
27    RollUpApply {
28        compare_columns: Vec<String>,
29        collect_column: Option<String>,
30    },
31}
32
33#[derive(Debug, Clone, Copy, PartialEq, Eq)]
34pub enum ApplyKind {
35    Standard,
36    Semi,
37    Anti,
38    Single,
39    All,
40}