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:
dennis zhuang
2022-06-17 11:36:49 +08:00
committed by GitHub
parent e03ac2fc2b
commit e78c015fc0
36 changed files with 1438 additions and 110 deletions

View File

@@ -31,6 +31,8 @@ pub enum StatusCode {
// ====== Begin of catalog related status code =====
/// Table already exists.
TableAlreadyExists,
TableNotFound,
TableColumnNotFound,
// ====== End of catalog related status code =======
}

View File

@@ -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());
}
}