Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused codes #16834

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/query/catalog/src/table_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ use databend_common_users::GrantObjectVisibilityChecker;
use databend_storages_common_session::SessionState;
use databend_storages_common_session::TxnManagerRef;
use databend_storages_common_table_meta::meta::Location;
use databend_storages_common_table_meta::meta::TableSnapshot;
use parking_lot::Mutex;
use parking_lot::RwLock;
use xorf::BinaryFuse16;
Expand Down Expand Up @@ -181,10 +180,6 @@ pub trait TableContext: Send + Sync {
fn get_compaction_num_block_hint(&self, _table_name: &str) -> u64 {
unimplemented!()
}
fn set_table_snapshot(&self, snapshot: Arc<TableSnapshot>);
fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>>;
fn set_lazy_mutation_delete(&self, lazy: bool);
fn get_lazy_mutation_delete(&self) -> bool;

fn attach_query_str(&self, kind: QueryKind, query: String);
fn attach_query_hash(&self, text_hash: String, parameterized_hash: String);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use std::collections::HashMap;

use databend_common_catalog::table::Table;
use databend_common_catalog::table_context::TableContext;
use databend_common_exception::Result;
use databend_common_expression::RemoteExpr;
use databend_common_functions::BUILTIN_FUNCTIONS;
Expand All @@ -25,10 +24,8 @@ use databend_common_sql::evaluator::BlockOperator;
use databend_common_sql::evaluator::CompoundBlockOperator;
use databend_common_sql::executor::physical_plans::ColumnMutation;
use databend_common_sql::executor::physical_plans::MutationKind;
use databend_common_storages_fuse::operations::TableMutationAggregator;
use databend_common_storages_fuse::operations::TransformSerializeBlock;
use databend_common_storages_fuse::FuseTable;
use databend_storages_common_table_meta::meta::Statistics;

use crate::pipelines::PipelineBuilder;

Expand Down Expand Up @@ -68,21 +65,6 @@ impl PipelineBuilder {
)?;
proc.into_processor()
})?;

if self.ctx.get_lazy_mutation_delete() {
self.main_pipeline.try_resize(1)?;
self.main_pipeline.add_async_accumulating_transformer(|| {
TableMutationAggregator::create(
table,
self.ctx.clone(),
self.ctx.get_table_snapshot().unwrap().segments.clone(),
vec![],
vec![],
Statistics::default(),
MutationKind::Delete,
)
});
}
} else {
let block_thresholds = table.get_block_thresholds();
let cluster_stats_gen = table.cluster_gen_for_append(
Expand Down
21 changes: 0 additions & 21 deletions src/query/service/src/sessions/query_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ use databend_common_users::UserApiProvider;
use databend_storages_common_session::SessionState;
use databend_storages_common_session::TxnManagerRef;
use databend_storages_common_table_meta::meta::Location;
use databend_storages_common_table_meta::meta::TableSnapshot;
use log::debug;
use log::info;
use parking_lot::Mutex;
Expand Down Expand Up @@ -151,8 +150,6 @@ pub struct QueryContext {
fragment_id: Arc<AtomicUsize>,
// Used by synchronized generate aggregating indexes when new data written.
inserted_segment_locs: Arc<RwLock<HashSet<Location>>>,
snapshot: Arc<RwLock<Option<Arc<TableSnapshot>>>>,
lazy_mutaion_delete: Arc<RwLock<bool>>,
}

impl QueryContext {
Expand All @@ -178,8 +175,6 @@ impl QueryContext {
fragment_id: Arc::new(AtomicUsize::new(0)),
inserted_segment_locs: Arc::new(RwLock::new(HashSet::new())),
block_threshold: Arc::new(RwLock::new(BlockThresholds::default())),
snapshot: Arc::new(RwLock::new(None)),
lazy_mutaion_delete: Arc::new(RwLock::new(false)),
})
}

Expand Down Expand Up @@ -532,22 +527,6 @@ impl TableContext for QueryContext {
Ok(())
}

fn set_table_snapshot(&self, snapshot: Arc<TableSnapshot>) {
*self.snapshot.write() = Some(snapshot);
}

fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>> {
self.snapshot.read().clone()
}

fn set_lazy_mutation_delete(&self, lazy: bool) {
*self.lazy_mutaion_delete.write() = lazy;
}

fn get_lazy_mutation_delete(&self) -> bool {
*self.lazy_mutaion_delete.read()
}

fn partition_num(&self) -> usize {
self.partition_queue.read().len()
}
Expand Down
17 changes: 0 additions & 17 deletions src/query/service/tests/it/sql/exec/get_table_bind_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ use databend_query::test_kits::*;
use databend_storages_common_session::SessionState;
use databend_storages_common_session::TxnManagerRef;
use databend_storages_common_table_meta::meta::Location;
use databend_storages_common_table_meta::meta::TableSnapshot;
use parking_lot::Mutex;
use parking_lot::RwLock;
use xorf::BinaryFuse16;
Expand Down Expand Up @@ -584,22 +583,6 @@ impl TableContext for CtxDelegation {
todo!()
}

fn set_table_snapshot(&self, _snapshot: Arc<TableSnapshot>) {
todo!()
}

fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>> {
todo!()
}

fn set_lazy_mutation_delete(&self, _lazy: bool) {
todo!()
}

fn get_lazy_mutation_delete(&self) -> bool {
todo!()
}

fn add_partitions_sha(&self, _sha: String) {
todo!()
}
Expand Down
16 changes: 0 additions & 16 deletions src/query/service/tests/it/storages/fuse/operations/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,22 +486,6 @@ impl TableContext for CtxDelegation {
todo!()
}

fn set_table_snapshot(&self, _snapshot: Arc<TableSnapshot>) {
todo!()
}

fn get_table_snapshot(&self) -> Option<Arc<TableSnapshot>> {
todo!()
}

fn set_lazy_mutation_delete(&self, _lazy: bool) {
todo!()
}

fn get_lazy_mutation_delete(&self) -> bool {
todo!()
}

fn add_partitions_sha(&self, _sha: String) {
todo!()
}
Expand Down
Loading