Skip to content

Commit e56df8a

Browse files
committed
refactor(query): iceberg catalog support information_shcema/system database
1 parent d12ab68 commit e56df8a

File tree

35 files changed

+1157
-353
lines changed

35 files changed

+1157
-353
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/query/management/src/procedure/procedure_mgr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl ProcedureMgr {
103103
Ok(dropped)
104104
}
105105

106-
//#[fastrace::trace]
106+
#[fastrace::trace]
107107
pub async fn get_procedure(
108108
&self,
109109
req: &GetProcedureReq,
@@ -121,6 +121,7 @@ impl ProcedureMgr {
121121
procedure_meta: seq_meta.data,
122122
}))
123123
}
124+
124125
#[fastrace::trace]
125126
pub async fn list_procedures(
126127
&self,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl Debug for DatabaseCatalog {
141141
impl DatabaseCatalog {
142142
#[async_backtrace::framed]
143143
pub async fn try_create_with_config(conf: InnerConfig) -> Result<DatabaseCatalog> {
144-
let immutable_catalog = ImmutableCatalog::try_create_with_config(&conf).await?;
144+
let immutable_catalog = ImmutableCatalog::try_create_with_config(Some(&conf), None)?;
145145
let mutable_catalog = MutableCatalog::try_create_with_config(conf).await?;
146146
let session_catalog = SessionCatalog::create(mutable_catalog, SessionState::default());
147147
let table_function_factory = TableFunctionFactory::create();

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

+11-7
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,22 @@ impl Debug for ImmutableCatalog {
122122

123123
impl ImmutableCatalog {
124124
#[async_backtrace::framed]
125-
pub async fn try_create_with_config(conf: &InnerConfig) -> Result<Self> {
125+
pub fn try_create_with_config(
126+
conf: Option<&InnerConfig>,
127+
catalog_name: Option<&String>,
128+
) -> Result<Self> {
126129
// The global db meta.
127130
let mut sys_db_meta = InMemoryMetas::create(SYS_DB_ID_BEGIN, SYS_TBL_ID_BEGIN);
128131
sys_db_meta.init_db("system");
129132
sys_db_meta.init_db("information_schema");
130133

131-
let sys_db = SystemDatabase::create(&mut sys_db_meta, conf);
132-
let info_schema_db = InformationSchemaDatabase::create(&mut sys_db_meta);
134+
let catalog_name = if let Some(ctl_name) = catalog_name {
135+
ctl_name
136+
} else {
137+
"default"
138+
};
139+
let sys_db = SystemDatabase::create(&mut sys_db_meta, conf, catalog_name);
140+
let info_schema_db = InformationSchemaDatabase::create(&mut sys_db_meta, catalog_name);
133141

134142
Ok(Self {
135143
info_schema_db: Arc::new(info_schema_db),
@@ -472,8 +480,6 @@ impl Catalog for ImmutableCatalog {
472480
))
473481
}
474482

475-
// Table index
476-
477483
#[async_backtrace::framed]
478484
async fn create_index(&self, _req: CreateIndexReq) -> Result<CreateIndexReply> {
479485
unimplemented!()
@@ -512,8 +518,6 @@ impl Catalog for ImmutableCatalog {
512518
unimplemented!()
513519
}
514520

515-
// Virtual column
516-
517521
#[async_backtrace::framed]
518522
async fn create_virtual_column(&self, _req: CreateVirtualColumnReq) -> Result<()> {
519523
unimplemented!()

0 commit comments

Comments
 (0)