Skip to content

Commit e34ae24

Browse files
committed
Use GlobalConfig.
1 parent 15f0a24 commit e34ae24

File tree

20 files changed

+13
-55
lines changed

20 files changed

+13
-55
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/query/catalog/src/catalog/interface.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ pub trait Catalog: DynClone + Send + Sync {
177177
&self,
178178
_func_name: &str,
179179
_tbl_args: TableArgs,
180-
_conf: &common_config::Config,
181180
) -> Result<Arc<dyn TableFunction>> {
182181
Err(ErrorCode::Unimplemented(
183182
"'get_table_function' not implemented",

src/query/service/src/catalogs/default/database_catalog.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,8 @@ impl Catalog for DatabaseCatalog {
474474
&self,
475475
func_name: &str,
476476
tbl_args: TableArgs,
477-
conf: &common_config::Config,
478477
) -> Result<Arc<dyn TableFunction>> {
479-
self.table_function_factory.get(func_name, tbl_args, conf)
478+
self.table_function_factory.get(func_name, tbl_args)
480479
}
481480

482481
fn get_table_engines(&self) -> Vec<StorageDescription> {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ impl QueryContext {
9595
table_args: Option<Vec<DataValue>>,
9696
) -> Result<Arc<dyn Table>> {
9797
let catalog = self.get_catalog(catalog_name)?;
98-
let conf = self.get_config();
9998
if table_args.is_none() {
10099
catalog.get_table_by_info(table_info)
101100
} else {
102101
Ok(catalog
103-
.get_table_function(&table_info.name, table_args, &conf)?
102+
.get_table_function(&table_info.name, table_args)?
104103
.as_table())
105104
}
106105
}

src/query/service/src/table_functions/async_crash_me.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ impl AsyncCrashMeTable {
5555
_table_func_name: &str,
5656
table_id: u64,
5757
table_args: TableArgs,
58-
_conf: &common_config::Config,
5958
) -> Result<Arc<dyn TableFunction>> {
6059
let mut panic_message = None;
6160
if let Some(args) = &table_args {

src/query/service/src/table_functions/numbers/numbers_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ impl NumbersTable {
5959
table_func_name: &str,
6060
table_id: u64,
6161
table_args: TableArgs,
62-
_conf: &common_config::Config,
6362
) -> Result<Arc<dyn TableFunction>> {
6463
let mut total = None;
6564
if let Some(args) = &table_args {

src/query/service/src/table_functions/sync_crash_me.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ impl SyncCrashMeTable {
5555
_table_func_name: &str,
5656
table_id: u64,
5757
table_args: TableArgs,
58-
_conf: &common_config::Config,
5958
) -> Result<Arc<dyn TableFunction>> {
6059
let mut panic_message = None;
6160
if let Some(args) = &table_args {

src/query/service/src/table_functions/table_function_factory.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use std::collections::HashMap;
1616
use std::sync::Arc;
1717

18-
use common_config::Config;
1918
use common_datavalues::DataValue;
2019
use common_exception::ErrorCode;
2120
use common_exception::Result;
@@ -45,13 +44,12 @@ pub trait TableFunctionCreator: Send + Sync {
4544
tbl_func_name: &str,
4645
tbl_id: MetaId,
4746
arg: TableArgs,
48-
conf: &Config,
4947
) -> Result<Arc<dyn TableFunction>>;
5048
}
5149

5250
impl<T> TableFunctionCreator for T
5351
where
54-
T: Fn(&str, &str, MetaId, TableArgs, &Config) -> Result<Arc<dyn TableFunction>>,
52+
T: Fn(&str, &str, MetaId, TableArgs) -> Result<Arc<dyn TableFunction>>,
5553
T: Send + Sync,
5654
{
5755
fn try_create(
@@ -60,9 +58,8 @@ where
6058
tbl_func_name: &str,
6159
tbl_id: MetaId,
6260
arg: TableArgs,
63-
conf: &Config,
6461
) -> Result<Arc<dyn TableFunction>> {
65-
self(db_name, tbl_func_name, tbl_id, arg, conf)
62+
self(db_name, tbl_func_name, tbl_id, arg)
6663
}
6764
}
6865

@@ -145,18 +142,13 @@ impl TableFunctionFactory {
145142
}
146143
}
147144

148-
pub fn get(
149-
&self,
150-
func_name: &str,
151-
tbl_args: TableArgs,
152-
conf: &Config,
153-
) -> Result<Arc<dyn TableFunction>> {
145+
pub fn get(&self, func_name: &str, tbl_args: TableArgs) -> Result<Arc<dyn TableFunction>> {
154146
let lock = self.creators.read();
155147
let func_name = func_name.to_lowercase();
156148
let (id, factory) = lock.get(&func_name).ok_or_else(|| {
157149
ErrorCode::UnknownTable(format!("Unknown table function {}", func_name))
158150
})?;
159-
let func = factory.try_create("", &func_name, *id, tbl_args, conf)?;
151+
let func = factory.try_create("", &func_name, *id, tbl_args)?;
160152
Ok(func)
161153
}
162154
}

src/query/service/tests/it/storages/fuse/table_test_fixture.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,7 @@ pub async fn test_drive_with_args_and_ctx(
350350
tbl_args: TableArgs,
351351
ctx: Arc<QueryContext>,
352352
) -> Result<SendableDataBlockStream> {
353-
let func = FuseSnapshotTable::create(
354-
"system",
355-
"fuse_snapshot",
356-
1,
357-
tbl_args,
358-
&common_config::Config::default(),
359-
)?;
353+
let func = FuseSnapshotTable::create("system", "fuse_snapshot", 1, tbl_args)?;
360354
let source_plan = func
361355
.clone()
362356
.as_table()
@@ -372,13 +366,7 @@ pub async fn test_drive_clustering_information(
372366
tbl_args: TableArgs,
373367
ctx: Arc<QueryContext>,
374368
) -> Result<SendableDataBlockStream> {
375-
let func = ClusteringInformationTable::create(
376-
"system",
377-
"clustering_information",
378-
1,
379-
tbl_args,
380-
&common_config::Config::default(),
381-
)?;
369+
let func = ClusteringInformationTable::create("system", "clustering_information", 1, tbl_args)?;
382370
let source_plan = func
383371
.clone()
384372
.as_table()

src/query/service/tests/it/table_functions/numbers_table.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@ use crate::tests::TestGlobalServices;
3636
async fn test_number_table() -> Result<()> {
3737
let tbl_args = Some(vec![DataValue::UInt64(8)]);
3838
let (_guard, ctx) = crate::tests::create_query_context().await?;
39-
let table = NumbersTable::create(
40-
"system",
41-
"numbers_mt",
42-
1,
43-
tbl_args,
44-
&common_config::Config::default(),
45-
)?;
39+
let table = NumbersTable::create("system", "numbers_mt", 1, tbl_args)?;
4640

4741
let source_plan = table
4842
.clone()

0 commit comments

Comments
 (0)