use std::sync::Arc;
use super::ColumnSelector;
#[derive(Clone, Debug, PartialEq)]
pub enum Literal {
Bool(bool),
I64(i64),
F64(f64),
Utf8(Arc<str>),
Date32(i32),
TimestampMs(i64),
}
impl From<&str> for Literal {
fn from(value: &str) -> Self {
Self::Utf8(Arc::from(value))
}
}
impl From<String> for Literal {
fn from(value: String) -> Self {
Self::Utf8(Arc::from(value))
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CompareOp {
Eq,
NotEq,
Lt,
Lte,
Gt,
Gte,
Contains,
StartsWith,
EndsWith,
IsNull,
IsNotNull,
}
#[derive(Clone, Debug, PartialEq)]
pub enum Predicate {
Comparison {
column: ColumnSelector,
op: CompareOp,
value: Option<Literal>,
},
And(Vec<Predicate>),
Or(Vec<Predicate>),
Not(Box<Predicate>),
}