diff --git a/src/catalog/src/kvbackend/manager.rs b/src/catalog/src/kvbackend/manager.rs index 85b12e6b1bbd..0bf51643b1b1 100644 --- a/src/catalog/src/kvbackend/manager.rs +++ b/src/catalog/src/kvbackend/manager.rs @@ -29,7 +29,6 @@ use common_meta::key::table_info::TableInfoValue; use common_meta::key::table_name::TableNameKey; use common_meta::key::{TableMetadataManager, TableMetadataManagerRef}; use common_meta::kv_backend::KvBackendRef; -use common_meta::table_name::TableName; use futures_util::stream::BoxStream; use futures_util::{StreamExt, TryStreamExt}; use meta_client::client::MetaClient; @@ -38,6 +37,7 @@ use partition::manager::{PartitionRuleManager, PartitionRuleManagerRef}; use snafu::prelude::*; use table::dist_table::DistTable; use table::table::numbers::{NumbersTable, NUMBERS_TABLE_NAME}; +use table::table_name::TableName; use table::TableRef; use crate::error::{ diff --git a/src/catalog/src/kvbackend/table_cache.rs b/src/catalog/src/kvbackend/table_cache.rs index 4ab73bf9d256..93980d1a0612 100644 --- a/src/catalog/src/kvbackend/table_cache.rs +++ b/src/catalog/src/kvbackend/table_cache.rs @@ -17,11 +17,11 @@ use std::sync::Arc; use common_meta::cache::{CacheContainer, Initializer, TableInfoCacheRef, TableNameCacheRef}; use common_meta::error::{Result as MetaResult, ValueNotExistSnafu}; use common_meta::instruction::CacheIdent; -use common_meta::table_name::TableName; use futures::future::BoxFuture; use moka::future::Cache; use snafu::OptionExt; use table::dist_table::DistTable; +use table::table_name::TableName; use table::TableRef; pub type TableCacheRef = Arc; diff --git a/src/cmd/src/cli/bench.rs b/src/cmd/src/cli/bench.rs index 7f0acfe378bf..bf5a6825f014 100644 --- a/src/cmd/src/cli/bench.rs +++ b/src/cmd/src/cli/bench.rs @@ -23,13 +23,13 @@ use common_meta::key::{TableMetadataManager, TableMetadataManagerRef}; use common_meta::kv_backend::etcd::EtcdStore; use common_meta::peer::Peer; use common_meta::rpc::router::{Region, RegionRoute}; -use common_meta::table_name::TableName; use common_telemetry::info; use datatypes::data_type::ConcreteDataType; use datatypes::schema::{ColumnSchema, RawSchema}; use rand::Rng; use store_api::storage::RegionNumber; use table::metadata::{RawTableInfo, RawTableMeta, TableId, TableIdent, TableType}; +use table::table_name::TableName; use tracing_appender::non_blocking::WorkerGuard; use self::metadata::TableMetadataBencher; diff --git a/src/cmd/src/cli/bench/metadata.rs b/src/cmd/src/cli/bench/metadata.rs index a1009cfe8d6c..9229b0342e88 100644 --- a/src/cmd/src/cli/bench/metadata.rs +++ b/src/cmd/src/cli/bench/metadata.rs @@ -16,7 +16,7 @@ use std::time::Instant; use common_meta::key::table_route::TableRouteValue; use common_meta::key::TableMetadataManagerRef; -use common_meta::table_name::TableName; +use table::table_name::TableName; use crate::cli::bench::{ bench_self_recorded, create_region_routes, create_region_wal_options, create_table_info, diff --git a/src/common/meta/src/cache/flow/table_flownode.rs b/src/common/meta/src/cache/flow/table_flownode.rs index eeaa88128628..faf62b8c36f6 100644 --- a/src/common/meta/src/cache/flow/table_flownode.rs +++ b/src/common/meta/src/cache/flow/table_flownode.rs @@ -145,13 +145,13 @@ mod tests { use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; use moka::future::CacheBuilder; + use table::table_name::TableName; use crate::cache::flow::table_flownode::new_table_flownode_set_cache; use crate::instruction::{CacheIdent, CreateFlow, DropFlow}; use crate::key::flow::flow_info::FlowInfoValue; use crate::key::flow::FlowMetadataManager; use crate::kv_backend::memory::MemoryKvBackend; - use crate::table_name::TableName; #[tokio::test] async fn test_cache_empty_set() { diff --git a/src/common/meta/src/cache/table/table_name.rs b/src/common/meta/src/cache/table/table_name.rs index 0ec88a2d6e9d..926e4de66f63 100644 --- a/src/common/meta/src/cache/table/table_name.rs +++ b/src/common/meta/src/cache/table/table_name.rs @@ -18,6 +18,7 @@ use futures::future::BoxFuture; use moka::future::Cache; use snafu::OptionExt; use table::metadata::TableId; +use table::table_name::TableName; use crate::cache::{CacheContainer, Initializer}; use crate::error; @@ -25,7 +26,6 @@ use crate::error::Result; use crate::instruction::CacheIdent; use crate::key::table_name::{TableNameKey, TableNameManager, TableNameManagerRef}; use crate::kv_backend::KvBackendRef; -use crate::table_name::TableName; /// [TableNameCache] caches the [TableName] to [TableId] mapping. pub type TableNameCache = CacheContainer; diff --git a/src/common/meta/src/ddl/alter_logical_tables/table_cache_keys.rs b/src/common/meta/src/ddl/alter_logical_tables/table_cache_keys.rs index 23cf22e2c02c..15f6bfbd6f33 100644 --- a/src/common/meta/src/ddl/alter_logical_tables/table_cache_keys.rs +++ b/src/common/meta/src/ddl/alter_logical_tables/table_cache_keys.rs @@ -13,10 +13,10 @@ // limitations under the License. use table::metadata::RawTableInfo; +use table::table_name::TableName; use crate::ddl::alter_logical_tables::AlterLogicalTablesProcedure; use crate::instruction::CacheIdent; -use crate::table_name::TableName; impl AlterLogicalTablesProcedure { pub(crate) fn build_table_cache_keys_to_invalidate(&self) -> Vec { diff --git a/src/common/meta/src/ddl/create_logical_tables/update_metadata.rs b/src/common/meta/src/ddl/create_logical_tables/update_metadata.rs index 61ec611f850f..0309a046138f 100644 --- a/src/common/meta/src/ddl/create_logical_tables/update_metadata.rs +++ b/src/common/meta/src/ddl/create_logical_tables/update_metadata.rs @@ -18,13 +18,13 @@ use common_telemetry::{info, warn}; use itertools::Itertools; use snafu::OptionExt; use table::metadata::TableId; +use table::table_name::TableName; use crate::cache_invalidator::Context; use crate::ddl::create_logical_tables::CreateLogicalTablesProcedure; use crate::ddl::physical_table_metadata; use crate::error::{Result, TableInfoNotFoundSnafu}; use crate::instruction::CacheIdent; -use crate::table_name::TableName; impl CreateLogicalTablesProcedure { pub(crate) async fn update_physical_table_metadata(&mut self) -> Result<()> { diff --git a/src/common/meta/src/ddl/drop_database/cursor.rs b/src/common/meta/src/ddl/drop_database/cursor.rs index bf1750eb1669..c3dd8a582684 100644 --- a/src/common/meta/src/ddl/drop_database/cursor.rs +++ b/src/common/meta/src/ddl/drop_database/cursor.rs @@ -20,6 +20,7 @@ use futures::TryStreamExt; use serde::{Deserialize, Serialize}; use snafu::OptionExt; use table::metadata::{TableId, TableType}; +use table::table_name::TableName; use super::executor::DropDatabaseExecutor; use super::metadata::DropDatabaseRemoveMetadata; @@ -30,7 +31,6 @@ use crate::ddl::DdlContext; use crate::error::{Result, TableInfoNotFoundSnafu}; use crate::instruction::CacheIdent; use crate::key::table_route::TableRouteValue; -use crate::table_name::TableName; #[derive(Debug, Serialize, Deserialize)] pub(crate) struct DropDatabaseCursor { diff --git a/src/common/meta/src/ddl/drop_database/executor.rs b/src/common/meta/src/ddl/drop_database/executor.rs index 48b840e8d9bf..f3a7f9a9fff5 100644 --- a/src/common/meta/src/ddl/drop_database/executor.rs +++ b/src/common/meta/src/ddl/drop_database/executor.rs @@ -19,6 +19,7 @@ use common_telemetry::info; use serde::{Deserialize, Serialize}; use snafu::OptionExt; use table::metadata::TableId; +use table::table_name::TableName; use super::cursor::DropDatabaseCursor; use super::{DropDatabaseContext, DropTableTarget}; @@ -29,7 +30,6 @@ use crate::error::{self, Result}; use crate::key::table_route::TableRouteValue; use crate::region_keeper::OperatingRegionGuard; use crate::rpc::router::{operating_leader_regions, RegionRoute}; -use crate::table_name::TableName; #[derive(Debug, Serialize, Deserialize)] pub(crate) struct DropDatabaseExecutor { @@ -135,6 +135,7 @@ mod tests { use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; use common_error::ext::BoxedError; use common_recordbatch::SendableRecordBatchStream; + use table::table_name::TableName; use crate::ddl::drop_database::cursor::DropDatabaseCursor; use crate::ddl::drop_database::executor::DropDatabaseExecutor; @@ -144,7 +145,6 @@ mod tests { use crate::key::datanode_table::DatanodeTableKey; use crate::peer::Peer; use crate::rpc::router::region_distribution; - use crate::table_name::TableName; use crate::test_util::{new_ddl_context, MockDatanodeHandler, MockDatanodeManager}; #[derive(Clone)] diff --git a/src/common/meta/src/ddl/drop_table/executor.rs b/src/common/meta/src/ddl/drop_table/executor.rs index aa41d03c6597..0783ce86ccaf 100644 --- a/src/common/meta/src/ddl/drop_table/executor.rs +++ b/src/common/meta/src/ddl/drop_table/executor.rs @@ -23,6 +23,7 @@ use futures::future::join_all; use snafu::ensure; use store_api::storage::RegionId; use table::metadata::TableId; +use table::table_name::TableName; use crate::cache_invalidator::Context; use crate::ddl::utils::add_peer_context_if_needed; @@ -32,7 +33,6 @@ use crate::instruction::CacheIdent; use crate::key::table_name::TableNameKey; use crate::key::table_route::TableRouteValue; use crate::rpc::router::{find_leader_regions, find_leaders, RegionRoute}; -use crate::table_name::TableName; /// [Control] indicated to the caller whether to go to the next step. #[derive(Debug)] @@ -224,6 +224,7 @@ mod tests { use api::v1::{ColumnDataType, SemanticType}; use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; use table::metadata::RawTableInfo; + use table::table_name::TableName; use super::*; use crate::ddl::test_util::columns::TestColumnDefBuilder; @@ -231,7 +232,6 @@ mod tests { build_raw_table_info_from_expr, TestCreateTableExprBuilder, }; use crate::key::table_route::TableRouteValue; - use crate::table_name::TableName; use crate::test_util::{new_ddl_context, MockDatanodeManager}; fn test_create_raw_table_info(name: &str) -> RawTableInfo { diff --git a/src/common/meta/src/ddl/tests/create_flow.rs b/src/common/meta/src/ddl/tests/create_flow.rs index e79fe27b848f..a130e0590c47 100644 --- a/src/common/meta/src/ddl/tests/create_flow.rs +++ b/src/common/meta/src/ddl/tests/create_flow.rs @@ -19,6 +19,7 @@ use std::sync::Arc; use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; use common_procedure_test::execute_procedure_until_done; use session::context::QueryContext; +use table::table_name::TableName; use crate::ddl::create_flow::CreateFlowProcedure; use crate::ddl::test_util::create_table::test_create_table_task; @@ -27,7 +28,6 @@ use crate::ddl::DdlContext; use crate::key::table_route::TableRouteValue; use crate::key::FlowId; use crate::rpc::ddl::CreateFlowTask; -use crate::table_name::TableName; use crate::test_util::{new_ddl_context, MockFlownodeManager}; use crate::{error, ClusterId}; diff --git a/src/common/meta/src/ddl/tests/drop_flow.rs b/src/common/meta/src/ddl/tests/drop_flow.rs index b8b62b76cc61..97b4632a595a 100644 --- a/src/common/meta/src/ddl/tests/drop_flow.rs +++ b/src/common/meta/src/ddl/tests/drop_flow.rs @@ -18,6 +18,7 @@ use std::sync::Arc; use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; use common_procedure_test::execute_procedure_until_done; +use table::table_name::TableName; use crate::ddl::drop_flow::DropFlowProcedure; use crate::ddl::test_util::create_table::test_create_table_task; @@ -26,7 +27,6 @@ use crate::ddl::tests::create_flow::create_test_flow; use crate::error; use crate::key::table_route::TableRouteValue; use crate::rpc::ddl::DropFlowTask; -use crate::table_name::TableName; use crate::test_util::{new_ddl_context, MockFlownodeManager}; fn test_drop_flow_task(flow_name: &str, flow_id: u32, drop_if_exists: bool) -> DropFlowTask { diff --git a/src/common/meta/src/ddl/truncate_table.rs b/src/common/meta/src/ddl/truncate_table.rs index ce1341c0add2..edc7321e091c 100644 --- a/src/common/meta/src/ddl/truncate_table.rs +++ b/src/common/meta/src/ddl/truncate_table.rs @@ -28,6 +28,7 @@ use snafu::{ensure, ResultExt}; use store_api::storage::RegionId; use strum::AsRefStr; use table::metadata::{RawTableInfo, TableId}; +use table::table_name::TableName; use table::table_reference::TableReference; use super::utils::handle_retry_error; @@ -40,7 +41,6 @@ use crate::key::DeserializedValueWithBytes; use crate::lock_key::{CatalogLock, SchemaLock, TableLock}; use crate::rpc::ddl::TruncateTableTask; use crate::rpc::router::{find_leader_regions, find_leaders, RegionRoute}; -use crate::table_name::TableName; use crate::{metrics, ClusterId}; pub struct TruncateTableProcedure { diff --git a/src/common/meta/src/instruction.rs b/src/common/meta/src/instruction.rs index 7820985b6571..aee1844b0f80 100644 --- a/src/common/meta/src/instruction.rs +++ b/src/common/meta/src/instruction.rs @@ -20,11 +20,11 @@ use serde::{Deserialize, Serialize}; use store_api::storage::{RegionId, RegionNumber}; use strum::Display; use table::metadata::TableId; +use table::table_name::TableName; use crate::flow_name::FlowName; use crate::key::schema_name::SchemaName; use crate::key::FlowId; -use crate::table_name::TableName; use crate::{ClusterId, DatanodeId, FlownodeId}; #[derive(Eq, Hash, PartialEq, Clone, Debug, Serialize, Deserialize)] diff --git a/src/common/meta/src/key.rs b/src/common/meta/src/key.rs index ad5bd60ce2d6..f252e679211f 100644 --- a/src/common/meta/src/key.rs +++ b/src/common/meta/src/key.rs @@ -119,6 +119,7 @@ use serde::{Deserialize, Serialize}; use snafu::{ensure, OptionExt, ResultExt}; use store_api::storage::RegionNumber; use table::metadata::{RawTableInfo, TableId}; +use table::table_name::TableName; use table_info::{TableInfoKey, TableInfoManager, TableInfoValue}; use table_name::{TableNameKey, TableNameManager, TableNameValue}; use view_info::{ViewInfoKey, ViewInfoManager, ViewInfoValue}; @@ -138,7 +139,6 @@ use crate::kv_backend::txn::{Txn, TxnOp}; use crate::kv_backend::KvBackendRef; use crate::rpc::router::{region_distribution, RegionRoute, RegionStatus}; use crate::rpc::store::BatchDeleteRequest; -use crate::table_name::TableName; use crate::DatanodeId; pub const NAME_PATTERN: &str = r"[a-zA-Z_:-][a-zA-Z0-9_:\-\.]*"; @@ -1212,6 +1212,7 @@ mod tests { use futures::TryStreamExt; use store_api::storage::RegionId; use table::metadata::{RawTableInfo, TableInfo}; + use table::table_name::TableName; use super::datanode_table::DatanodeTableKey; use super::test_utils; @@ -1226,7 +1227,6 @@ mod tests { use crate::kv_backend::memory::MemoryKvBackend; use crate::peer::Peer; use crate::rpc::router::{region_distribution, Region, RegionRoute, RegionStatus}; - use crate::table_name::TableName; #[test] fn test_deserialized_value_with_bytes() { diff --git a/src/common/meta/src/key/flow.rs b/src/common/meta/src/key/flow.rs index 1f8db5585433..b2ce5d1cb24b 100644 --- a/src/common/meta/src/key/flow.rs +++ b/src/common/meta/src/key/flow.rs @@ -262,12 +262,12 @@ mod tests { use futures::TryStreamExt; use table::metadata::TableId; + use table::table_name::TableName; use super::*; use crate::key::flow::table_flow::TableFlowKey; use crate::key::FlowPartitionId; use crate::kv_backend::memory::MemoryKvBackend; - use crate::table_name::TableName; use crate::FlownodeId; #[derive(Debug)] diff --git a/src/common/meta/src/key/flow/flow_info.rs b/src/common/meta/src/key/flow/flow_info.rs index f08e7c5def56..c1ce1a1c994f 100644 --- a/src/common/meta/src/key/flow/flow_info.rs +++ b/src/common/meta/src/key/flow/flow_info.rs @@ -20,6 +20,7 @@ use regex::Regex; use serde::{Deserialize, Serialize}; use snafu::OptionExt; use table::metadata::TableId; +use table::table_name::TableName; use crate::error::{self, Result}; use crate::key::flow::FlowScoped; @@ -27,7 +28,6 @@ use crate::key::txn_helper::TxnOpGetResponseSet; use crate::key::{DeserializedValueWithBytes, FlowId, FlowPartitionId, MetaKey, TableMetaValue}; use crate::kv_backend::txn::Txn; use crate::kv_backend::KvBackendRef; -use crate::table_name::TableName; use crate::FlownodeId; const FLOW_INFO_KEY_PREFIX: &str = "info"; diff --git a/src/common/meta/src/key/table_info.rs b/src/common/meta/src/key/table_info.rs index b50d7bb6b037..a652b7caf0fd 100644 --- a/src/common/meta/src/key/table_info.rs +++ b/src/common/meta/src/key/table_info.rs @@ -19,6 +19,7 @@ use std::sync::Arc; use serde::{Deserialize, Serialize}; use snafu::OptionExt; use table::metadata::{RawTableInfo, TableId}; +use table::table_name::TableName; use table::table_reference::TableReference; use super::TABLE_INFO_KEY_PATTERN; @@ -28,7 +29,6 @@ use crate::key::{DeserializedValueWithBytes, MetaKey, TableMetaValue, TABLE_INFO use crate::kv_backend::txn::Txn; use crate::kv_backend::KvBackendRef; use crate::rpc::store::BatchGetRequest; -use crate::table_name::TableName; /// The key stores the metadata of the table. /// diff --git a/src/common/meta/src/key/table_name.rs b/src/common/meta/src/key/table_name.rs index b337fe086662..8a44de7cc695 100644 --- a/src/common/meta/src/key/table_name.rs +++ b/src/common/meta/src/key/table_name.rs @@ -20,6 +20,7 @@ use futures_util::stream::BoxStream; use serde::{Deserialize, Serialize}; use snafu::OptionExt; use table::metadata::TableId; +use table::table_name::TableName; use super::{MetaKey, TableMetaValue, TABLE_NAME_KEY_PATTERN, TABLE_NAME_KEY_PREFIX}; use crate::error::{Error, InvalidTableMetadataSnafu, Result}; @@ -29,7 +30,6 @@ use crate::kv_backend::KvBackendRef; use crate::range_stream::{PaginationStream, DEFAULT_PAGE_SIZE}; use crate::rpc::store::{BatchGetRequest, RangeRequest}; use crate::rpc::KeyValue; -use crate::table_name::TableName; #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)] pub struct TableNameKey<'a> { diff --git a/src/common/meta/src/lib.rs b/src/common/meta/src/lib.rs index 05e80af0e01a..78d111c479a9 100644 --- a/src/common/meta/src/lib.rs +++ b/src/common/meta/src/lib.rs @@ -40,7 +40,6 @@ pub mod region_keeper; pub mod rpc; pub mod sequence; pub mod state_store; -pub use table::table_name; #[cfg(any(test, feature = "testing"))] pub mod test_util; pub mod util; diff --git a/src/common/meta/src/rpc/ddl.rs b/src/common/meta/src/rpc/ddl.rs index eadd2b4e449e..e6140cdaeff7 100644 --- a/src/common/meta/src/rpc/ddl.rs +++ b/src/common/meta/src/rpc/ddl.rs @@ -39,11 +39,11 @@ use serde_with::{serde_as, DefaultOnNull}; use session::context::QueryContextRef; use snafu::{OptionExt, ResultExt}; use table::metadata::{RawTableInfo, TableId}; +use table::table_name::TableName; use table::table_reference::TableReference; use crate::error::{self, Result}; use crate::key::FlowId; -use crate::table_name::TableName; /// DDL tasks #[derive(Debug, Clone)] diff --git a/src/common/meta/src/rpc/router.rs b/src/common/meta/src/rpc/router.rs index 31be66f64954..3e609e4af4d8 100644 --- a/src/common/meta/src/rpc/router.rs +++ b/src/common/meta/src/rpc/router.rs @@ -25,11 +25,11 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use snafu::OptionExt; use store_api::storage::{RegionId, RegionNumber}; use strum::AsRefStr; +use table::table_name::TableName; use crate::error::{self, Result}; use crate::key::RegionDistribution; use crate::peer::Peer; -use crate::table_name::TableName; use crate::DatanodeId; pub fn region_distribution(region_routes: &[RegionRoute]) -> RegionDistribution { diff --git a/src/frontend/src/instance/grpc.rs b/src/frontend/src/instance/grpc.rs index 7be2c09ec1d4..6597e049aa3b 100644 --- a/src/frontend/src/instance/grpc.rs +++ b/src/frontend/src/instance/grpc.rs @@ -18,7 +18,6 @@ use api::v1::query_request::Query; use api::v1::{DeleteRequests, DropFlowExpr, InsertRequests, RowDeleteRequests, RowInsertRequests}; use async_trait::async_trait; use auth::{PermissionChecker, PermissionCheckerRef, PermissionReq}; -use common_meta::table_name::TableName; use common_query::Output; use common_telemetry::tracing; use query::parser::PromQuery; @@ -27,6 +26,7 @@ use servers::query_handler::grpc::GrpcQueryHandler; use servers::query_handler::sql::SqlQueryHandler; use session::context::QueryContextRef; use snafu::{ensure, OptionExt, ResultExt}; +use table::table_name::TableName; use crate::error::{ Error, IncompleteGrpcRequestSnafu, NotSupportedSnafu, PermissionSnafu, Result, diff --git a/src/frontend/src/script.rs b/src/frontend/src/script.rs index 68a7d780ae9e..5cda392d112f 100644 --- a/src/frontend/src/script.rs +++ b/src/frontend/src/script.rs @@ -72,12 +72,12 @@ mod python { use arc_swap::ArcSwap; use catalog::RegisterSystemTableRequest; use common_error::ext::BoxedError; - use common_meta::table_name::TableName; use common_telemetry::{error, info}; use script::manager::ScriptManager; use servers::query_handler::grpc::GrpcQueryHandler; use session::context::QueryContext; use snafu::{OptionExt, ResultExt}; + use table::table_name::TableName; use super::*; use crate::error::{CatalogSnafu, TableNotFoundSnafu}; diff --git a/src/meta-srv/src/procedure/region_failover.rs b/src/meta-srv/src/procedure/region_failover.rs index 7d82ad36d520..9ee017ad15a6 100644 --- a/src/meta-srv/src/procedure/region_failover.rs +++ b/src/meta-srv/src/procedure/region_failover.rs @@ -29,7 +29,6 @@ use common_meta::key::datanode_table::DatanodeTableKey; use common_meta::key::{TableMetadataManagerRef, MAINTENANCE_KEY}; use common_meta::kv_backend::{KvBackendRef, ResettableKvBackendRef}; use common_meta::lock_key::{CatalogLock, RegionLock, SchemaLock, TableLock}; -use common_meta::table_name::TableName; use common_meta::{ClusterId, RegionIdent}; use common_procedure::error::{ Error as ProcedureError, FromJsonSnafu, Result as ProcedureResult, ToJsonSnafu, @@ -44,6 +43,7 @@ use serde::{Deserialize, Serialize}; use snafu::ResultExt; use store_api::storage::{RegionId, RegionNumber}; use table::metadata::TableId; +use table::table_name::TableName; use crate::error::{ self, KvBackendSnafu, RegisterProcedureLoaderSnafu, Result, TableMetadataManagerSnafu, diff --git a/src/meta-srv/src/procedure/region_migration/manager.rs b/src/meta-srv/src/procedure/region_migration/manager.rs index 7dde629cbdb9..871342fd4fef 100644 --- a/src/meta-srv/src/procedure/region_migration/manager.rs +++ b/src/meta-srv/src/procedure/region_migration/manager.rs @@ -22,12 +22,12 @@ use common_meta::key::table_info::TableInfoValue; use common_meta::key::table_route::TableRouteValue; use common_meta::peer::Peer; use common_meta::rpc::router::RegionRoute; -use common_meta::table_name::TableName; use common_meta::ClusterId; use common_procedure::{watcher, ProcedureId, ProcedureManagerRef, ProcedureWithId}; use common_telemetry::{error, info}; use snafu::{ensure, OptionExt, ResultExt}; use store_api::storage::RegionId; +use table::table_name::TableName; use crate::error::{self, Result}; use crate::procedure::region_migration::{ diff --git a/src/operator/src/statement.rs b/src/operator/src/statement.rs index e9b6f4b282c0..649af286a4bb 100644 --- a/src/operator/src/statement.rs +++ b/src/operator/src/statement.rs @@ -32,7 +32,6 @@ use common_meta::ddl::ProcedureExecutorRef; use common_meta::key::flow::{FlowMetadataManager, FlowMetadataManagerRef}; use common_meta::key::{TableMetadataManager, TableMetadataManagerRef}; use common_meta::kv_backend::KvBackendRef; -use common_meta::table_name::TableName; use common_query::Output; use common_telemetry::tracing; use common_time::range::TimestampRange; @@ -50,6 +49,7 @@ use sql::statements::OptionMap; use sql::util::format_raw_object_name; use sqlparser::ast::ObjectName; use table::requests::{CopyDatabaseRequest, CopyDirection, CopyTableRequest}; +use table::table_name::TableName; use table::table_reference::TableReference; use table::TableRef; diff --git a/src/operator/src/statement/ddl.rs b/src/operator/src/statement/ddl.rs index 8280510a5b78..2cfe71fd0d24 100644 --- a/src/operator/src/statement/ddl.rs +++ b/src/operator/src/statement/ddl.rs @@ -32,7 +32,6 @@ use common_meta::rpc::ddl::{ CreateFlowTask, DdlTask, DropFlowTask, SubmitDdlTaskRequest, SubmitDdlTaskResponse, }; use common_meta::rpc::router::{Partition, Partition as MetaPartition}; -use common_meta::table_name::TableName; use common_query::Output; use common_telemetry::{debug, info, tracing}; use common_time::Timezone; @@ -62,6 +61,7 @@ use substrait::{DFLogicalSubstraitConvertor, SubstraitPlan}; use table::dist_table::DistTable; use table::metadata::{self, RawTableInfo, RawTableMeta, TableId, TableInfo, TableType}; use table::requests::{AlterKind, AlterTableRequest, TableOptions, COMMENT_KEY}; +use table::table_name::TableName; use table::TableRef; use super::StatementExecutor; diff --git a/src/operator/src/statement/show.rs b/src/operator/src/statement/show.rs index ca1a500c2a38..a89df5985206 100644 --- a/src/operator/src/statement/show.rs +++ b/src/operator/src/statement/show.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use common_meta::table_name::TableName; use common_query::Output; use common_telemetry::tracing; use partition::manager::PartitionInfo; @@ -24,6 +23,7 @@ use sql::statements::create::Partitions; use sql::statements::show::{ ShowColumns, ShowDatabases, ShowIndex, ShowKind, ShowTables, ShowVariables, }; +use table::table_name::TableName; use table::TableRef; use crate::error::{self, ExecuteStatementSnafu, Result}; diff --git a/src/query/src/dist_plan/merge_scan.rs b/src/query/src/dist_plan/merge_scan.rs index 59b2e1bde605..1af2516d233a 100644 --- a/src/query/src/dist_plan/merge_scan.rs +++ b/src/query/src/dist_plan/merge_scan.rs @@ -21,7 +21,6 @@ use async_stream::stream; use common_base::bytes::Bytes; use common_catalog::parse_catalog_and_schema_from_db_string; use common_error::ext::BoxedError; -use common_meta::table_name::TableName; use common_plugins::GREPTIME_EXEC_READ_COST; use common_recordbatch::adapter::{DfRecordBatchStreamAdapter, RecordBatchMetrics}; use common_recordbatch::error::ExternalSnafu; @@ -48,6 +47,7 @@ use meter_macros::read_meter; use session::context::QueryContextRef; use snafu::ResultExt; use store_api::storage::RegionId; +use table::table_name::TableName; use tokio::time::Instant; use crate::error::ConvertSchemaSnafu; diff --git a/src/query/src/dist_plan/planner.rs b/src/query/src/dist_plan/planner.rs index da48cb026844..4bb0cccc020c 100644 --- a/src/query/src/dist_plan/planner.rs +++ b/src/query/src/dist_plan/planner.rs @@ -19,7 +19,6 @@ use std::sync::Arc; use async_trait::async_trait; use catalog::CatalogManagerRef; use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; -use common_meta::table_name::TableName; use datafusion::common::Result; use datafusion::datasource::DefaultTableSource; use datafusion::execution::context::SessionState; @@ -35,6 +34,7 @@ use store_api::storage::RegionId; use substrait::{DFLogicalSubstraitConvertor, SubstraitPlan}; pub use table::metadata::TableType; use table::table::adapter::DfTableProviderAdapter; +use table::table_name::TableName; use crate::dist_plan::merge_scan::{MergeScanExec, MergeScanLogicalPlan}; use crate::error; diff --git a/src/query/src/plan.rs b/src/query/src/plan.rs index 62a98d78ab0b..ea9dae3770da 100644 --- a/src/query/src/plan.rs +++ b/src/query/src/plan.rs @@ -15,7 +15,6 @@ use std::collections::{HashMap, HashSet}; use std::fmt::{Debug, Display}; -use common_meta::table_name::TableName; use common_query::prelude::ScalarValue; use datafusion::datasource::DefaultTableSource; use datafusion_common::tree_node::{Transformed, TreeNode, TreeNodeRewriter}; @@ -27,6 +26,7 @@ use session::context::QueryContextRef; use snafu::ResultExt; pub use table::metadata::TableType; use table::table::adapter::DfTableProviderAdapter; +use table::table_name::TableName; use crate::error::{ConvertDatafusionSchemaSnafu, DataFusionSnafu, Result};