refactor: make table scan return physical plan (#326)

* refactor: return PhysicalPlan in Table trait's scan method, to support partitioned execution in Frontend's distribute read

* refactor: pub use necessary DataFusion types

* refactor: replace old "PhysicalPlan" and its adapters

Co-authored-by: luofucong <luofucong@greptime.com>
Co-authored-by: Yingwen <realevenyag@gmail.com>
This commit is contained in:
LFC
2022-10-25 11:34:53 +08:00
committed by GitHub
parent 64dac51e83
commit 2ca667cbdf
39 changed files with 920 additions and 600 deletions

View File

@@ -364,8 +364,8 @@ mod tests {
insert_expr, Column, ColumnDataType,
};
use common_base::BitVec;
use common_query::physical_plan::PhysicalPlanRef;
use common_query::prelude::Expr;
use common_recordbatch::SendableRecordBatchStream;
use common_time::timestamp::Timestamp;
use datatypes::{
data_type::ConcreteDataType,
@@ -552,7 +552,7 @@ mod tests {
_projection: &Option<Vec<usize>>,
_filters: &[Expr],
_limit: Option<usize>,
) -> TableResult<SendableRecordBatchStream> {
) -> TableResult<PhysicalPlanRef> {
unimplemented!();
}
}

View File

@@ -2,17 +2,16 @@ use std::sync::Arc;
use common_grpc::AsExcutionPlan;
use common_grpc::DefaultAsPlanImpl;
use common_query::physical_plan::PhysicalPlanAdapter;
use common_query::physical_plan::PhysicalPlanRef;
use common_query::Output;
use datatypes::schema::Schema;
use query::PhysicalPlanAdapter;
use query::{plan::PhysicalPlan, QueryEngineRef};
use query::QueryEngineRef;
use snafu::ResultExt;
use crate::error::Result;
use crate::error::{ConvertSchemaSnafu, ExecutePhysicalPlanSnafu, IntoPhysicalPlanSnafu};
pub type PhysicalPlanRef = Arc<dyn PhysicalPlan>;
pub struct PhysicalPlanner {
query_engine: QueryEngineRef,
}

View File

@@ -92,7 +92,7 @@ mod tests {
use catalog::SchemaProvider;
use common_query::logical_plan::Expr;
use common_recordbatch::SendableRecordBatchStream;
use common_query::physical_plan::PhysicalPlanRef;
use common_time::timestamp::Timestamp;
use datatypes::prelude::ConcreteDataType;
use datatypes::schema::{ColumnSchema, SchemaBuilder, SchemaRef};
@@ -146,7 +146,7 @@ mod tests {
_projection: &Option<Vec<usize>>,
_filters: &[Expr],
_limit: Option<usize>,
) -> TableResult<SendableRecordBatchStream> {
) -> TableResult<PhysicalPlanRef> {
unimplemented!();
}
}