Skip to content

Commit

Permalink
fix(meta): fix type conversion (#18638)
Browse files Browse the repository at this point in the history
  • Loading branch information
zwang28 authored Sep 23, 2024
1 parent 8fa0468 commit 9231782
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/meta/src/controller/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2921,16 +2921,23 @@ impl CatalogController {

pub async fn get_all_table_options(&self) -> MetaResult<HashMap<TableId, TableOption>> {
let inner = self.inner.read().await;
let table_options: Vec<(TableId, Option<u32>)> = Table::find()
let table_options: Vec<(TableId, Option<i32>)> = Table::find()
.select_only()
.columns([table::Column::TableId, table::Column::RetentionSeconds])
.into_tuple::<(TableId, Option<u32>)>()
.into_tuple::<(TableId, Option<i32>)>()
.all(&inner.db)
.await?;

Ok(table_options
.into_iter()
.map(|(id, retention_seconds)| (id, TableOption { retention_seconds }))
.map(|(id, retention_seconds)| {
(
id,
TableOption {
retention_seconds: retention_seconds.map(|i| i.try_into().unwrap()),
},
)
})
.collect())
}

Expand Down

0 comments on commit 9231782

Please sign in to comment.