mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-19 22:40:40 +00:00
TableEngine and SqlHandler impl (#45)
* Impl TableEngine, bridge to storage * Impl sql handler to process insert sql * fix: minor changes and typo * test: add datanode test * test: add table-engine test * fix: code style * refactor: split out insert mod from sql and minor changes by CR * refactor: replace with_context with context
This commit is contained in:
@@ -8,11 +8,27 @@ pub struct Expr {
|
||||
}
|
||||
|
||||
impl Expr {
|
||||
pub fn new(df_expr: DfExpr) -> Self {
|
||||
Self { df_expr }
|
||||
}
|
||||
|
||||
pub fn df_expr(&self) -> &DfExpr {
|
||||
&self.df_expr
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DfExpr> for Expr {
|
||||
fn from(df_expr: DfExpr) -> Self {
|
||||
Self { df_expr }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_from_df_expr() {
|
||||
let df_expr = DfExpr::Wildcard;
|
||||
|
||||
let expr: Expr = df_expr.into();
|
||||
|
||||
assert_eq!(DfExpr::Wildcard, *expr.df_expr());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user