From b062d8515d8c8745f337de90ea7fedf85003e414 Mon Sep 17 00:00:00 2001 From: jeremyhi Date: Thu, 29 Aug 2024 14:17:51 +0800 Subject: [PATCH] feat: copy database ignores view and temporary tables (#4640) feat: copy database ingores view and temporary tables --- src/operator/src/statement/copy_database.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/operator/src/statement/copy_database.rs b/src/operator/src/statement/copy_database.rs index a4b1b9267b2c..134dd2355926 100644 --- a/src/operator/src/statement/copy_database.rs +++ b/src/operator/src/statement/copy_database.rs @@ -67,11 +67,6 @@ impl StatementExecutor { let mut exported_rows = 0; for table_name in table_names { - // TODO(hl): remove this hardcode once we've removed numbers table. - if table_name == "numbers" { - continue; - } - let table = self .get_table(&TableReference { catalog: &req.catalog_name, @@ -79,6 +74,10 @@ impl StatementExecutor { table: &table_name, }) .await?; + // Only base tables, ignores views and temporary tables. + if table.table_type() != table::metadata::TableType::Base { + continue; + } // Ignores physical tables of metric engine. if table.table_info().meta.engine == METRIC_ENGINE_NAME && !table