Skip to content

Commit 6c05298

Browse files
authored
chore: remove unused codes (#16834)
remove unused codes
1 parent e909334 commit 6c05298

File tree

5 files changed

+0
-77
lines changed

5 files changed

+0
-77
lines changed

src/query/catalog/src/table_context.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ use databend_common_users::GrantObjectVisibilityChecker;
6161
use databend_storages_common_session::SessionState;
6262
use databend_storages_common_session::TxnManagerRef;
6363
use databend_storages_common_table_meta::meta::Location;
64-
use databend_storages_common_table_meta::meta::TableSnapshot;
6564
use parking_lot::Mutex;
6665
use parking_lot::RwLock;
6766
use xorf::BinaryFuse16;
@@ -181,10 +180,6 @@ pub trait TableContext: Send + Sync {
181180
fn get_compaction_num_block_hint(&self, _table_name: &str) -> u64 {
182181
unimplemented!()
183182
}
184-
fn set_table_snapshot(&self, snapshot: Arc<TableSnapshot>);
185-
fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>>;
186-
fn set_lazy_mutation_delete(&self, lazy: bool);
187-
fn get_lazy_mutation_delete(&self) -> bool;
188183

189184
fn attach_query_str(&self, kind: QueryKind, query: String);
190185
fn attach_query_hash(&self, text_hash: String, parameterized_hash: String);

src/query/service/src/pipelines/builders/builder_column_mutation.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use std::collections::HashMap;
1616

1717
use databend_common_catalog::table::Table;
18-
use databend_common_catalog::table_context::TableContext;
1918
use databend_common_exception::Result;
2019
use databend_common_expression::RemoteExpr;
2120
use databend_common_functions::BUILTIN_FUNCTIONS;
@@ -25,10 +24,8 @@ use databend_common_sql::evaluator::BlockOperator;
2524
use databend_common_sql::evaluator::CompoundBlockOperator;
2625
use databend_common_sql::executor::physical_plans::ColumnMutation;
2726
use databend_common_sql::executor::physical_plans::MutationKind;
28-
use databend_common_storages_fuse::operations::TableMutationAggregator;
2927
use databend_common_storages_fuse::operations::TransformSerializeBlock;
3028
use databend_common_storages_fuse::FuseTable;
31-
use databend_storages_common_table_meta::meta::Statistics;
3229

3330
use crate::pipelines::PipelineBuilder;
3431

@@ -68,21 +65,6 @@ impl PipelineBuilder {
6865
)?;
6966
proc.into_processor()
7067
})?;
71-
72-
if self.ctx.get_lazy_mutation_delete() {
73-
self.main_pipeline.try_resize(1)?;
74-
self.main_pipeline.add_async_accumulating_transformer(|| {
75-
TableMutationAggregator::create(
76-
table,
77-
self.ctx.clone(),
78-
self.ctx.get_table_snapshot().unwrap().segments.clone(),
79-
vec![],
80-
vec![],
81-
Statistics::default(),
82-
MutationKind::Delete,
83-
)
84-
});
85-
}
8668
} else {
8769
let block_thresholds = table.get_block_thresholds();
8870
let cluster_stats_gen = table.cluster_gen_for_append(

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ use databend_common_users::UserApiProvider;
113113
use databend_storages_common_session::SessionState;
114114
use databend_storages_common_session::TxnManagerRef;
115115
use databend_storages_common_table_meta::meta::Location;
116-
use databend_storages_common_table_meta::meta::TableSnapshot;
117116
use log::debug;
118117
use log::info;
119118
use parking_lot::Mutex;
@@ -151,8 +150,6 @@ pub struct QueryContext {
151150
fragment_id: Arc<AtomicUsize>,
152151
// Used by synchronized generate aggregating indexes when new data written.
153152
inserted_segment_locs: Arc<RwLock<HashSet<Location>>>,
154-
snapshot: Arc<RwLock<Option<Arc<TableSnapshot>>>>,
155-
lazy_mutaion_delete: Arc<RwLock<bool>>,
156153
}
157154

158155
impl QueryContext {
@@ -178,8 +175,6 @@ impl QueryContext {
178175
fragment_id: Arc::new(AtomicUsize::new(0)),
179176
inserted_segment_locs: Arc::new(RwLock::new(HashSet::new())),
180177
block_threshold: Arc::new(RwLock::new(BlockThresholds::default())),
181-
snapshot: Arc::new(RwLock::new(None)),
182-
lazy_mutaion_delete: Arc::new(RwLock::new(false)),
183178
})
184179
}
185180

@@ -532,22 +527,6 @@ impl TableContext for QueryContext {
532527
Ok(())
533528
}
534529

535-
fn set_table_snapshot(&self, snapshot: Arc<TableSnapshot>) {
536-
*self.snapshot.write() = Some(snapshot);
537-
}
538-
539-
fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>> {
540-
self.snapshot.read().clone()
541-
}
542-
543-
fn set_lazy_mutation_delete(&self, lazy: bool) {
544-
*self.lazy_mutaion_delete.write() = lazy;
545-
}
546-
547-
fn get_lazy_mutation_delete(&self) -> bool {
548-
*self.lazy_mutaion_delete.read()
549-
}
550-
551530
fn partition_num(&self) -> usize {
552531
self.partition_queue.read().len()
553532
}

src/query/service/tests/it/sql/exec/get_table_bind_test.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ use databend_query::test_kits::*;
148148
use databend_storages_common_session::SessionState;
149149
use databend_storages_common_session::TxnManagerRef;
150150
use databend_storages_common_table_meta::meta::Location;
151-
use databend_storages_common_table_meta::meta::TableSnapshot;
152151
use parking_lot::Mutex;
153152
use parking_lot::RwLock;
154153
use xorf::BinaryFuse16;
@@ -584,22 +583,6 @@ impl TableContext for CtxDelegation {
584583
todo!()
585584
}
586585

587-
fn set_table_snapshot(&self, _snapshot: Arc<TableSnapshot>) {
588-
todo!()
589-
}
590-
591-
fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>> {
592-
todo!()
593-
}
594-
595-
fn set_lazy_mutation_delete(&self, _lazy: bool) {
596-
todo!()
597-
}
598-
599-
fn get_lazy_mutation_delete(&self) -> bool {
600-
todo!()
601-
}
602-
603586
fn add_partitions_sha(&self, _sha: String) {
604587
todo!()
605588
}

src/query/service/tests/it/storages/fuse/operations/commit.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -486,22 +486,6 @@ impl TableContext for CtxDelegation {
486486
todo!()
487487
}
488488

489-
fn set_table_snapshot(&self, _snapshot: Arc<TableSnapshot>) {
490-
todo!()
491-
}
492-
493-
fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>> {
494-
todo!()
495-
}
496-
497-
fn set_lazy_mutation_delete(&self, _lazy: bool) {
498-
todo!()
499-
}
500-
501-
fn get_lazy_mutation_delete(&self) -> bool {
502-
todo!()
503-
}
504-
505489
fn add_partitions_sha(&self, _sha: String) {
506490
todo!()
507491
}

0 commit comments

Comments
 (0)