mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-24 08:50:40 +00:00
feat: query engine impl on datafusion (#10)
* feat: query engine impl on datafusion * feat: adds physical_optimizer, physical_planner and executor * feat: impl adpaters between datafuion and greptime query engine core APIs. * feat: impl PhysicalPlanAdapter and ExecutionPlanAdapter * feat: rename table datafusion mod to adapter * fix: clippy warning * fix: conflicts with develop branch * feat: add database mod * fix: CR comment * fix: by CR comments * fix: conflicts with develop branch * fix: by CR comments
This commit is contained in:
7
src/common/query/Cargo.toml
Normal file
7
src/common/query/Cargo.toml
Normal file
@@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "common-query"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
datafusion = { git = "https://github.com/apache/arrow-datafusion.git" , branch = "arrow2", features = ["simd"]}
|
||||
1
src/common/query/src/lib.rs
Normal file
1
src/common/query/src/lib.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod logical_plan;
|
||||
18
src/common/query/src/logical_plan/expr.rs
Normal file
18
src/common/query/src/logical_plan/expr.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use datafusion::logical_plan::Expr as DfExpr;
|
||||
|
||||
/// Central struct of query API.
|
||||
/// Represent logical expressions such as `A + 1`, or `CAST(c1 AS int)`.
|
||||
#[derive(Clone, PartialEq, Hash)]
|
||||
pub struct Expr {
|
||||
df_expr: DfExpr,
|
||||
}
|
||||
|
||||
impl Expr {
|
||||
pub fn new(df_expr: DfExpr) -> Self {
|
||||
Self { df_expr }
|
||||
}
|
||||
|
||||
pub fn df_expr(&self) -> &DfExpr {
|
||||
&self.df_expr
|
||||
}
|
||||
}
|
||||
3
src/common/query/src/logical_plan/mod.rs
Normal file
3
src/common/query/src/logical_plan/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod expr;
|
||||
|
||||
pub use self::expr::Expr;
|
||||
Reference in New Issue
Block a user