Skip to content

Commit ec91213

Browse files
authored
chore(meta): remove tenant for table info (#14647)
* chore(executor): remove catalog ident name for profile * chore(meta): remove tenant for table info * chore(meta): remove tenant for table info * chore(meta): remove tenant for table info
1 parent 3382953 commit ec91213

File tree

2 files changed

+81
-33
lines changed

2 files changed

+81
-33
lines changed

src/meta/api/src/schema_api_impl.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,7 +2184,10 @@ impl<KV: kvapi::KVApi<Error = MetaError> + ?Sized> SchemaApi for KV {
21842184
table_id: tbid.table_id,
21852185
seq: tb_meta_seq,
21862186
},
2187-
desc: tenant_dbname_tbname.to_string(),
2187+
desc: format!(
2188+
"'{}'.'{}'",
2189+
tenant_dbname.db_name, tenant_dbname_tbname.table_name
2190+
),
21882191
name: tenant_dbname_tbname.table_name.clone(),
21892192
// Safe unwrap() because: tb_meta_seq > 0
21902193
meta: tb_meta.unwrap(),
@@ -2307,7 +2310,10 @@ impl<KV: kvapi::KVApi<Error = MetaError> + ?Sized> SchemaApi for KV {
23072310
table_id,
23082311
seq: tb_meta_seq,
23092312
},
2310-
desc: tenant_dbname_tbname.to_string(),
2313+
desc: format!(
2314+
"'{}'.'{}'",
2315+
tenant_dbname.db_name, tenant_dbname_tbname.table_name
2316+
),
23112317
name: table_id_list_key.table_name.clone(),
23122318
meta: tb_meta,
23132319
tenant: tenant_dbname.tenant.clone(),
@@ -4580,7 +4586,10 @@ async fn batch_filter_table_info(
45804586
table_id,
45814587
seq: *tb_meta_seq,
45824588
},
4583-
desc: tenant_dbname_tbname.to_string(),
4589+
desc: format!(
4590+
"'{}'.'{}'",
4591+
tenant_dbname.db_name, tenant_dbname_tbname.table_name
4592+
),
45844593
name: table_name.clone(),
45854594
meta: tb_meta,
45864595
tenant: tenant_dbname.tenant.clone(),

src/meta/api/src/schema_api_test_suite.rs

Lines changed: 69 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ impl SchemaApiTestSuite {
17591759

17601760
let want = TableInfo {
17611761
ident,
1762-
desc: format!("'{}'.'{}'.'{}'", tenant, db_name, tbl_name),
1762+
desc: format!("'{}'.'{}'", db_name, tbl_name),
17631763
name: tbl_name.into(),
17641764
meta: table_meta(created_on),
17651765
tenant: tenant.to_string(),
@@ -1788,7 +1788,7 @@ impl SchemaApiTestSuite {
17881788
let got = mt.get_table((tenant, db_name, tbl_name).into()).await?;
17891789
let want = TableInfo {
17901790
ident: tb_ident_2,
1791-
desc: format!("'{}'.'{}'.'{}'", tenant, db_name, tbl_name),
1791+
desc: format!("'{}'.'{}'", db_name, tbl_name),
17921792
name: tbl_name.into(),
17931793
meta: table_meta(created_on),
17941794
tenant: tenant.to_string(),
@@ -1825,7 +1825,7 @@ impl SchemaApiTestSuite {
18251825
let got = mt.get_table((tenant, "db1", "tb2").into()).await.unwrap();
18261826
let want = TableInfo {
18271827
ident: tb_ident_2,
1828-
desc: format!("'{}'.'{}'.'{}'", tenant, db_name, tbl_name),
1828+
desc: format!("'{}'.'{}'", db_name, tbl_name),
18291829
name: tbl_name.into(),
18301830
meta: table_meta(created_on),
18311831
tenant: tenant.to_string(),
@@ -2247,7 +2247,7 @@ impl SchemaApiTestSuite {
22472247
let got = mt.get_table((tenant, db1_name, tb3_name).into()).await?;
22482248
let want = TableInfo {
22492249
ident: tb_ident,
2250-
desc: format!("'{}'.'{}'.'{}'", tenant, db1_name, tb3_name),
2250+
desc: format!("'{}'.'{}'", db1_name, tb3_name),
22512251
name: tb3_name.into(),
22522252
meta: table_meta(created_on),
22532253
tenant: tenant.to_string(),
@@ -2383,7 +2383,7 @@ impl SchemaApiTestSuite {
23832383
let got = mt.get_table((tenant, db2_name, tb3_name).into()).await?;
23842384
let want = TableInfo {
23852385
ident: tb_ident2,
2386-
desc: format!("'{}'.'{}'.'{}'", tenant, db2_name, tb3_name),
2386+
desc: format!("'{}'.'{}'", db2_name, tb3_name),
23872387
name: tb3_name.into(),
23882388
meta: table_meta(created_on),
23892389
tenant: tenant.to_string(),
@@ -2465,7 +2465,7 @@ impl SchemaApiTestSuite {
24652465

24662466
let want = TableInfo {
24672467
ident,
2468-
desc: format!("'{}'.'{}'.'{}'", tenant, db_name, tbl_name),
2468+
desc: format!("'{}'.'{}'", db_name, tbl_name),
24692469
name: tbl_name.into(),
24702470
meta: table_meta(created_on),
24712471
tenant: tenant.to_string(),
@@ -3054,7 +3054,7 @@ impl SchemaApiTestSuite {
30543054

30553055
let want = TableInfo {
30563056
ident,
3057-
desc: format!("'{}'.'{}'.'{}'", tenant, db_name, tbl_name),
3057+
desc: format!("'{}'.'{}'", db_name, tbl_name),
30583058
name: tbl_name.into(),
30593059
meta: table_meta(created_on),
30603060
tenant: tenant.to_string(),
@@ -4174,9 +4174,9 @@ impl SchemaApiTestSuite {
41744174
assert_eq!(sort_drop_ids, drop_ids_1);
41754175

41764176
let expected: BTreeSet<String> = [
4177-
"'tenant1'.'db1'.'tb1'".to_string(),
4178-
"'tenant1'.'db2'.'tb1'".to_string(),
4179-
"'tenant1'.'db3'.'tb1'".to_string(),
4177+
"'db1'.'tb1'".to_string(),
4178+
"'db2'.'tb1'".to_string(),
4179+
"'db3'.'tb1'".to_string(),
41804180
]
41814181
.iter()
41824182
.cloned()
@@ -4206,12 +4206,12 @@ impl SchemaApiTestSuite {
42064206
assert_eq!(sort_drop_ids, drop_ids_2);
42074207

42084208
let expected: BTreeSet<String> = [
4209-
"'tenant1'.'db1'.'tb1'".to_string(),
4210-
"'tenant1'.'db2'.'tb1'".to_string(),
4211-
"'tenant1'.'db2'.'tb2'".to_string(),
4212-
"'tenant1'.'db2'.'tb3'".to_string(),
4213-
"'tenant1'.'db3'.'tb1'".to_string(),
4214-
"'tenant1'.'db3'.'tb2'".to_string(),
4209+
"'db1'.'tb1'".to_string(),
4210+
"'db2'.'tb1'".to_string(),
4211+
"'db2'.'tb2'".to_string(),
4212+
"'db2'.'tb3'".to_string(),
4213+
"'db3'.'tb1'".to_string(),
4214+
"'db3'.'tb2'".to_string(),
42154215
]
42164216
.iter()
42174217
.cloned()
@@ -4519,7 +4519,10 @@ impl SchemaApiTestSuite {
45194519

45204520
calc_and_compare_drop_on_table_result(res, vec![DroponInfo {
45214521
name: tbl_name.to_string(),
4522-
desc: tbl_name_ident.to_string(),
4522+
desc: format!(
4523+
"'{}'.'{}'",
4524+
tbl_name_ident.db_name, tbl_name_ident.table_name
4525+
),
45234526
drop_on_cnt: 0,
45244527
non_drop_on_cnt: 1,
45254528
}]);
@@ -4558,7 +4561,10 @@ impl SchemaApiTestSuite {
45584561
.await?;
45594562
calc_and_compare_drop_on_table_result(res, vec![DroponInfo {
45604563
name: tbl_name.to_string(),
4561-
desc: tbl_name_ident.to_string(),
4564+
desc: format!(
4565+
"'{}'.'{}'",
4566+
tbl_name_ident.db_name, tbl_name_ident.table_name
4567+
),
45624568
drop_on_cnt: 1,
45634569
non_drop_on_cnt: 0,
45644570
}]);
@@ -4583,7 +4589,10 @@ impl SchemaApiTestSuite {
45834589
.await?;
45844590
calc_and_compare_drop_on_table_result(res, vec![DroponInfo {
45854591
name: tbl_name.to_string(),
4586-
desc: tbl_name_ident.to_string(),
4592+
desc: format!(
4593+
"'{}'.'{}'",
4594+
tbl_name_ident.db_name, tbl_name_ident.table_name
4595+
),
45874596
drop_on_cnt: 0,
45884597
non_drop_on_cnt: 1,
45894598
}]);
@@ -4615,7 +4624,10 @@ impl SchemaApiTestSuite {
46154624
.await?;
46164625
calc_and_compare_drop_on_table_result(res, vec![DroponInfo {
46174626
name: tbl_name.to_string(),
4618-
desc: tbl_name_ident.to_string(),
4627+
desc: format!(
4628+
"'{}'.'{}'",
4629+
tbl_name_ident.db_name, tbl_name_ident.table_name
4630+
),
46194631
drop_on_cnt: 1,
46204632
non_drop_on_cnt: 0,
46214633
}]);
@@ -4645,7 +4657,10 @@ impl SchemaApiTestSuite {
46454657

46464658
calc_and_compare_drop_on_table_result(res, vec![DroponInfo {
46474659
name: tbl_name.to_string(),
4648-
desc: tbl_name_ident.to_string(),
4660+
desc: format!(
4661+
"'{}'.'{}'",
4662+
tbl_name_ident.db_name, tbl_name_ident.table_name
4663+
),
46494664
drop_on_cnt: 1,
46504665
non_drop_on_cnt: 1,
46514666
}]);
@@ -4675,7 +4690,10 @@ impl SchemaApiTestSuite {
46754690
.await?;
46764691
calc_and_compare_drop_on_table_result(res, vec![DroponInfo {
46774692
name: tbl_name.to_string(),
4678-
desc: tbl_name_ident.to_string(),
4693+
desc: format!(
4694+
"'{}'.'{}'",
4695+
tbl_name_ident.db_name, tbl_name_ident.table_name
4696+
),
46794697
drop_on_cnt: 2,
46804698
non_drop_on_cnt: 0,
46814699
}]);
@@ -4700,7 +4718,10 @@ impl SchemaApiTestSuite {
47004718

47014719
calc_and_compare_drop_on_table_result(res, vec![DroponInfo {
47024720
name: tbl_name.to_string(),
4703-
desc: tbl_name_ident.to_string(),
4721+
desc: format!(
4722+
"'{}'.'{}'",
4723+
tbl_name_ident.db_name, tbl_name_ident.table_name
4724+
),
47044725
drop_on_cnt: 1,
47054726
non_drop_on_cnt: 1,
47064727
}]);
@@ -4742,13 +4763,19 @@ impl SchemaApiTestSuite {
47424763
calc_and_compare_drop_on_table_result(res, vec![
47434764
DroponInfo {
47444765
name: tbl_name.to_string(),
4745-
desc: tbl_name_ident.to_string(),
4766+
desc: format!(
4767+
"'{}'.'{}'",
4768+
tbl_name_ident.db_name, tbl_name_ident.table_name
4769+
),
47464770
drop_on_cnt: 1,
47474771
non_drop_on_cnt: 1,
47484772
},
47494773
DroponInfo {
47504774
name: new_tbl_name.to_string(),
4751-
desc: new_tbl_name_ident.to_string(),
4775+
desc: format!(
4776+
"'{}'.'{}'",
4777+
new_tbl_name_ident.db_name, new_tbl_name_ident.table_name
4778+
),
47524779
drop_on_cnt: 0,
47534780
non_drop_on_cnt: 1,
47544781
},
@@ -4782,13 +4809,19 @@ impl SchemaApiTestSuite {
47824809
calc_and_compare_drop_on_table_result(res, vec![
47834810
DroponInfo {
47844811
name: tbl_name.to_string(),
4785-
desc: tbl_name_ident.to_string(),
4812+
desc: format!(
4813+
"'{}'.'{}'",
4814+
tbl_name_ident.db_name, tbl_name_ident.table_name
4815+
),
47864816
drop_on_cnt: 1,
47874817
non_drop_on_cnt: 1,
47884818
},
47894819
DroponInfo {
47904820
name: new_tbl_name.to_string(),
4791-
desc: new_tbl_name_ident.to_string(),
4821+
desc: format!(
4822+
"'{}'.'{}'",
4823+
new_tbl_name_ident.db_name, new_tbl_name_ident.table_name
4824+
),
47924825
drop_on_cnt: 1,
47934826
non_drop_on_cnt: 0,
47944827
},
@@ -4818,13 +4851,19 @@ impl SchemaApiTestSuite {
48184851
calc_and_compare_drop_on_table_result(res, vec![
48194852
DroponInfo {
48204853
name: tbl_name.to_string(),
4821-
desc: tbl_name_ident.to_string(),
4854+
desc: format!(
4855+
"'{}'.'{}'",
4856+
tbl_name_ident.db_name, tbl_name_ident.table_name
4857+
),
48224858
drop_on_cnt: 1,
48234859
non_drop_on_cnt: 0,
48244860
},
48254861
DroponInfo {
48264862
name: new_tbl_name.to_string(),
4827-
desc: new_tbl_name_ident.to_string(),
4863+
desc: format!(
4864+
"'{}'.'{}'",
4865+
new_tbl_name_ident.db_name, new_tbl_name_ident.table_name
4866+
),
48284867
drop_on_cnt: 1,
48294868
non_drop_on_cnt: 1,
48304869
},
@@ -4905,7 +4944,7 @@ impl SchemaApiTestSuite {
49054944

49064945
let want = TableInfo {
49074946
ident,
4908-
desc: format!("'{}'.'{}'.'{}'", tenant, db_name, tbl_name),
4947+
desc: format!("'{}'.'{}'", db_name, tbl_name),
49094948
name: tbl_name.into(),
49104949
meta: table_meta(created_on),
49114950
tenant: tenant.to_string(),

0 commit comments

Comments
 (0)