From 373ba206cd8d139de5f0e1c7a14dec061206e58b Mon Sep 17 00:00:00 2001 From: zwang28 <70626450+zwang28@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:30:12 +0800 Subject: [PATCH] fix(meta): fix type conversion (#18638) --- src/meta/src/controller/catalog.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/meta/src/controller/catalog.rs b/src/meta/src/controller/catalog.rs index 28e6c03fd6da..77dd0117f631 100644 --- a/src/meta/src/controller/catalog.rs +++ b/src/meta/src/controller/catalog.rs @@ -2914,16 +2914,23 @@ impl CatalogController { pub async fn get_all_table_options(&self) -> MetaResult> { let inner = self.inner.read().await; - let table_options: Vec<(TableId, Option)> = Table::find() + let table_options: Vec<(TableId, Option)> = Table::find() .select_only() .columns([table::Column::TableId, table::Column::RetentionSeconds]) - .into_tuple::<(TableId, Option)>() + .into_tuple::<(TableId, Option)>() .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()) }