Skip to content

Commit

Permalink
feat: INSERT logical plan support
Browse files Browse the repository at this point in the history
  • Loading branch information
holicc committed Jul 12, 2024
1 parent 6efb797 commit a73d551
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 116 deletions.
14 changes: 14 additions & 0 deletions src/logical/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ impl LogicalExpr {

columns
}

pub fn cast_to(&self, data_type: &DataType) -> LogicalExpr {
LogicalExpr::Cast(CastExpr {
expr: Box::new(self.clone()),
data_type: data_type.clone(),
})
}

pub fn alias(&self, name: impl Into<String>) -> LogicalExpr {
LogicalExpr::Alias(Alias {
expr: Box::new(self.clone()),
name: name.into(),
})
}
}

impl Display for LogicalExpr {
Expand Down
2 changes: 1 addition & 1 deletion src/logical/plan/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Display for Projection {
.iter()
.map(|f| f.to_string())
.collect::<Vec<String>>()
.join(",")
.join(", ")
)
}
}
Loading

0 comments on commit a73d551

Please sign in to comment.