mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-25 17:30:41 +00:00
feat: create tables in batch on prom write (#3246)
* feat: create tables in batch on prom write * feat: add logic table ids to log * fix: miss tabble ids in response
This commit is contained in:
@@ -162,9 +162,11 @@ impl CreateLogicalTablesProcedure {
|
||||
manager.create_logic_tables_metadata(tables_data).await?;
|
||||
}
|
||||
|
||||
info!("Created {num_tables} tables metadata for physical table {physical_table_id}");
|
||||
let table_ids = self.creator.data.real_table_ids();
|
||||
|
||||
Ok(Status::done_with_output(self.creator.data.real_table_ids()))
|
||||
info!("Created {num_tables} tables {table_ids:?} metadata for physical table {physical_table_id}");
|
||||
|
||||
Ok(Status::done_with_output(table_ids))
|
||||
}
|
||||
|
||||
fn create_region_request_builder(
|
||||
|
||||
@@ -203,7 +203,7 @@ impl TryFrom<PbSubmitDdlTaskResponse> for SubmitDdlTaskResponse {
|
||||
|
||||
fn try_from(resp: PbSubmitDdlTaskResponse) -> Result<Self> {
|
||||
let table_id = resp.table_id.map(|t| t.id);
|
||||
let table_ids = resp.table_ids.iter().map(|t| t.id).collect();
|
||||
let table_ids = resp.table_ids.into_iter().map(|t| t.id).collect();
|
||||
Ok(Self {
|
||||
key: resp.key,
|
||||
table_id,
|
||||
@@ -219,6 +219,11 @@ impl From<SubmitDdlTaskResponse> for PbSubmitDdlTaskResponse {
|
||||
table_id: val
|
||||
.table_id
|
||||
.map(|table_id| api::v1::meta::TableId { id: table_id }),
|
||||
table_ids: val
|
||||
.table_ids
|
||||
.into_iter()
|
||||
.map(|id| api::v1::meta::TableId { id })
|
||||
.collect(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user