Skip to content

Commit 6f76776

Browse files
committed
fix(processor): try fix test failure
1 parent 5acc981 commit 6f76776

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

src/query/catalog/src/table_context.rs

+2
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,6 @@ pub trait TableContext: Send + Sync {
108108
-> Result<Arc<dyn Table>>;
109109
fn get_processes_info(&self) -> Vec<ProcessInfo>;
110110
fn get_runtime(&self) -> Result<Arc<Runtime>>;
111+
112+
fn clone_inner(&self) -> Arc<dyn TableContext>;
111113
}

src/query/service/src/api/rpc/exchange/exchange_manager.rs

-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ impl FragmentCoordinator {
668668

669669
match &self.payload {
670670
FragmentPayload::PlanV2(plan) => {
671-
let ctx = QueryContext::create_from(ctx);
672671
let pipeline_builder = PipelineBuilderV2::create(ctx);
673672
self.pipeline_build_res = Some(pipeline_builder.finalize(plan)?);
674673
}

src/query/service/src/interpreters/interpreter_insert_v2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ impl Interpreter for InsertInterpreterV2 {
164164
_ => unreachable!(),
165165
};
166166

167-
table1.get_table_info();
168167
let catalog = self.plan.catalog.clone();
169168
let is_distributed_plan = select_plan.is_distributed_plan();
170169

src/query/service/src/sessions/query_ctx.rs

+4
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ impl TableContext for QueryContext {
386386
fn get_runtime(&self) -> Result<Arc<Runtime>> {
387387
self.shared.try_get_runtime()
388388
}
389+
390+
fn clone_inner(&self) -> Arc<dyn TableContext> {
391+
QueryContext::create_from_shared(self.shared.clone())
392+
}
389393
}
390394

391395
impl TrySpawn for QueryContext {

src/query/storages/fuse/src/operations/read.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl FuseTable {
7474
#[inline]
7575
pub fn do_read2(
7676
&self,
77-
ctx: Arc<dyn TableContext>,
77+
mut ctx: Arc<dyn TableContext>,
7878
plan: &ReadDataSourcePlan,
7979
pipeline: &mut Pipeline,
8080
) -> Result<()> {
@@ -87,6 +87,8 @@ impl FuseTable {
8787
}
8888

8989
if !lazy_init_segments.is_empty() {
90+
ctx = ctx.clone_inner();
91+
9092
let table_info = self.table_info.clone();
9193
let push_downs = plan.push_downs.clone();
9294
let query_ctx = ctx.clone();

0 commit comments

Comments
 (0)