quill_sql/plan/logical_plan/
project.rs

1use crate::catalog::SchemaRef;
2use crate::expression::Expr;
3use crate::plan::logical_plan::LogicalPlan;
4use std::sync::Arc;
5
6#[derive(derive_new::new, Debug, Clone)]
7pub struct Project {
8    pub exprs: Vec<Expr>,
9    pub input: Arc<LogicalPlan>,
10    pub schema: SchemaRef,
11}
12
13impl std::fmt::Display for Project {
14    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15        write!(
16            f,
17            "Project: {}",
18            self.exprs
19                .iter()
20                .map(|e| format!("{e}"))
21                .collect::<Vec<_>>()
22                .join(", ")
23        )
24    }
25}