Skip to content

Commit

Permalink
fix(processor): try fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang2014 committed Sep 30, 2022
1 parent 5acc981 commit 6f76776
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/query/catalog/src/table_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,6 @@ pub trait TableContext: Send + Sync {
-> Result<Arc<dyn Table>>;
fn get_processes_info(&self) -> Vec<ProcessInfo>;
fn get_runtime(&self) -> Result<Arc<Runtime>>;

fn clone_inner(&self) -> Arc<dyn TableContext>;
}
1 change: 0 additions & 1 deletion src/query/service/src/api/rpc/exchange/exchange_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ impl FragmentCoordinator {

match &self.payload {
FragmentPayload::PlanV2(plan) => {
let ctx = QueryContext::create_from(ctx);
let pipeline_builder = PipelineBuilderV2::create(ctx);
self.pipeline_build_res = Some(pipeline_builder.finalize(plan)?);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ impl Interpreter for InsertInterpreterV2 {
_ => unreachable!(),
};

table1.get_table_info();
let catalog = self.plan.catalog.clone();
let is_distributed_plan = select_plan.is_distributed_plan();

Expand Down
4 changes: 4 additions & 0 deletions src/query/service/src/sessions/query_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ impl TableContext for QueryContext {
fn get_runtime(&self) -> Result<Arc<Runtime>> {
self.shared.try_get_runtime()
}

fn clone_inner(&self) -> Arc<dyn TableContext> {
QueryContext::create_from_shared(self.shared.clone())
}
}

impl TrySpawn for QueryContext {
Expand Down
4 changes: 3 additions & 1 deletion src/query/storages/fuse/src/operations/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl FuseTable {
#[inline]
pub fn do_read2(
&self,
ctx: Arc<dyn TableContext>,
mut ctx: Arc<dyn TableContext>,
plan: &ReadDataSourcePlan,
pipeline: &mut Pipeline,
) -> Result<()> {
Expand All @@ -87,6 +87,8 @@ impl FuseTable {
}

if !lazy_init_segments.is_empty() {
ctx = ctx.clone_inner();

let table_info = self.table_info.clone();
let push_downs = plan.push_downs.clone();
let query_ctx = ctx.clone();
Expand Down

0 comments on commit 6f76776

Please sign in to comment.