use std::{
fmt::{self, Display},
sync::Arc,
};
use datafusion_common::{DFSchemaRef, OwnedTableReference};
use crate::LogicalPlan;
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct DmlStatement {
pub table_name: OwnedTableReference,
pub table_schema: DFSchemaRef,
pub op: WriteOp,
pub input: Arc<LogicalPlan>,
}
#[derive(Clone, PartialEq, Eq, Hash)]
pub enum WriteOp {
Insert,
Delete,
Update,
Ctas,
}
impl Display for WriteOp {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
WriteOp::Insert => write!(f, "Insert"),
WriteOp::Delete => write!(f, "Delete"),
WriteOp::Update => write!(f, "Update"),
WriteOp::Ctas => write!(f, "Ctas"),
}
}
}