Skip to content

Commit

Permalink
refactor: remove TableEngine (#3181)
Browse files Browse the repository at this point in the history
* refactor: remove TableEngine

Signed-off-by: Ruihang Xia <[email protected]>

* Update src/table/src/table_reference.rs

Co-authored-by: LFC <[email protected]>

---------

Signed-off-by: Ruihang Xia <[email protected]>
Co-authored-by: LFC <[email protected]>
  • Loading branch information
waynexia and MichaelScofield authored Jan 17, 2024
1 parent 204b943 commit fbd0197
Show file tree
Hide file tree
Showing 23 changed files with 90 additions and 510 deletions.
2 changes: 0 additions & 2 deletions src/catalog/src/kvbackend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ pub use client::{CachedMetaKvBackend, MetaKvBackend};
mod client;
mod manager;

#[cfg(feature = "testing")]
pub mod mock;
pub use manager::KvBackendCatalogManager;
128 changes: 0 additions & 128 deletions src/catalog/src/kvbackend/mock.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/common/grpc-expr/src/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use datatypes::data_type::{ConcreteDataType, DataType};
use datatypes::prelude::VectorRef;
use datatypes::schema::SchemaRef;
use snafu::{ensure, ResultExt};
use table::engine::TableReference;
use table::metadata::TableId;
use table::table_reference::TableReference;

use crate::error::{CreateVectorSnafu, Result, UnexpectedValuesLengthSnafu};
use crate::util;
Expand Down
2 changes: 1 addition & 1 deletion src/common/grpc-expr/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use api::v1::{
};
use datatypes::schema::Schema;
use snafu::{ensure, OptionExt};
use table::engine::TableReference;
use table::metadata::TableId;
use table::table_reference::TableReference;

use crate::error::{
DuplicatedColumnNameSnafu, DuplicatedTimestampColumnSnafu, MissingTimestampColumnSnafu, Result,
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/ddl/alter_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use serde::{Deserialize, Serialize};
use snafu::{ensure, OptionExt, ResultExt};
use store_api::storage::{ColumnId, RegionId};
use strum::AsRefStr;
use table::engine::TableReference;
use table::metadata::{RawTableInfo, TableId, TableInfo};
use table::requests::AlterKind;
use table::table_reference::TableReference;

use crate::cache_invalidator::Context;
use crate::ddl::utils::handle_operate_region_error;
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/ddl/create_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ use snafu::{ensure, OptionExt, ResultExt};
use store_api::metric_engine_consts::LOGICAL_TABLE_METADATA_KEY;
use store_api::storage::{RegionId, RegionNumber};
use strum::AsRefStr;
use table::engine::TableReference;
use table::metadata::{RawTableInfo, TableId};
use table::table_reference::TableReference;

use crate::ddl::utils::{handle_operate_region_error, handle_retry_error, region_storage_path};
use crate::ddl::DdlContext;
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/ddl/drop_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ use serde::{Deserialize, Serialize};
use snafu::{ensure, OptionExt, ResultExt};
use store_api::storage::RegionId;
use strum::AsRefStr;
use table::engine::TableReference;
use table::metadata::{RawTableInfo, TableId};
use table::table_reference::TableReference;

use super::utils::handle_retry_error;
use crate::cache_invalidator::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/ddl/truncate_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use serde::{Deserialize, Serialize};
use snafu::{ensure, ResultExt};
use store_api::storage::RegionId;
use strum::AsRefStr;
use table::engine::TableReference;
use table::metadata::{RawTableInfo, TableId};
use table::table_reference::TableReference;

use super::utils::handle_retry_error;
use crate::ddl::utils::handle_operate_region_error;
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/key/table_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
use std::collections::HashMap;

use serde::{Deserialize, Serialize};
use table::engine::TableReference;
use table::metadata::{RawTableInfo, TableId};
use table::table_reference::TableReference;

use super::{DeserializedValueWithBytes, TableMetaValue, TABLE_INFO_KEY_PREFIX};
use crate::error::Result;
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/rpc/ddl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use base64::Engine as _;
use prost::Message;
use serde::{Deserialize, Serialize};
use snafu::{OptionExt, ResultExt};
use table::engine::TableReference;
use table::metadata::{RawTableInfo, TableId};
use table::table_reference::TableReference;

use crate::error::{self, Result};
use crate::table_name::TableName;
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/table_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::fmt::{Display, Formatter};

use api::v1::meta::TableName as PbTableName;
use serde::{Deserialize, Serialize};
use table::engine::TableReference;
use table::table_reference::TableReference;

#[derive(Debug, Clone, Hash, Eq, PartialEq, Deserialize, Serialize)]
pub struct TableName {
Expand Down
2 changes: 1 addition & 1 deletion src/operator/src/expr_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ use sql::statements::alter::{AlterTable, AlterTableOperation};
use sql::statements::create::{CreateExternalTable, CreateTable, TIME_INDEX};
use sql::statements::{column_def_to_schema, sql_column_def_to_grpc_column_def};
use sql::util::to_lowercase_options_map;
use table::engine::TableReference;
use table::requests::{TableOptions, FILE_TABLE_META_KEY};
use table::table_reference::TableReference;

use crate::error::{
BuildCreateExprOnInsertionSnafu, ColumnDataTypeSnafu, ConvertColumnDefaultConstraintSnafu,
Expand Down
2 changes: 1 addition & 1 deletion src/operator/src/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ use partition::manager::PartitionRuleManagerRef;
use session::context::QueryContextRef;
use snafu::prelude::*;
use sql::statements::insert::Insert;
use table::engine::TableReference;
use table::requests::InsertRequest as TableInsertRequest;
use table::table_reference::TableReference;
use table::TableRef;

use crate::error::{
Expand Down
2 changes: 1 addition & 1 deletion src/operator/src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ use sql::statements::statement::Statement;
use sql::statements::OptionMap;
use sql::util::format_raw_object_name;
use sqlparser::ast::{Expr, ObjectName, Value};
use table::engine::TableReference;
use table::requests::{CopyDatabaseRequest, CopyDirection, CopyTableRequest};
use table::table_reference::TableReference;
use table::TableRef;

use crate::error::{
Expand Down
2 changes: 1 addition & 1 deletion src/operator/src/statement/copy_table_from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ use object_store::{Entry, EntryMode, ObjectStore};
use regex::Regex;
use session::context::QueryContextRef;
use snafu::ResultExt;
use table::engine::TableReference;
use table::requests::{CopyTableRequest, InsertRequest};
use table::table_reference::TableReference;
use tokio::io::BufReader;

use crate::error::{self, IntoVectorsSnafu, Result};
Expand Down
2 changes: 1 addition & 1 deletion src/operator/src/statement/copy_table_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ use object_store::ObjectStore;
use query::plan::LogicalPlan;
use session::context::QueryContextRef;
use snafu::{OptionExt, ResultExt};
use table::engine::TableReference;
use table::requests::CopyTableRequest;
use table::table::adapter::DfTableProviderAdapter;
use table::table_reference::TableReference;

use crate::error::{self, BuildDfLogicalPlanSnafu, ExecLogicalPlanSnafu, Result};
use crate::statement::StatementExecutor;
Expand Down
Loading

0 comments on commit fbd0197

Please sign in to comment.