Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename module sql to query_frontend #849

Merged
merged 2 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ members = [
"meta_client",
"partition_table_engine",
"query_engine",
"query_frontend",
"remote_engine_client",
"router",
"server",
"sql",
"system_catalog",
"table_engine",
"tools",
Expand Down Expand Up @@ -111,7 +111,7 @@ server = { path = "server" }
smallvec = "1.6"
slog = "2.7"
spin = "0.9.6"
sql = { path = "sql" }
query_frontend = { path = "query_frontend" }
sqlparser = { version = "0.32", features = ["serde"] }
system_catalog = { path = "system_catalog" }
table_engine = { path = "table_engine" }
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ anyhow = "1.0.58"
async-trait = "0.1"
ceresdb-client = "1.0"
local-ip-address = "0.5"
query_frontend = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
sql = { workspace = true }
sqlness = "0.4.3"
sqlparser = { workspace = true }
tokio = { workspace = true }
2 changes: 1 addition & 1 deletion integration_tests/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use ceresdb_client::{
model::sql_query::{display::CsvFormatter, Request},
RpcContext,
};
use query_frontend::{frontend, parser::Parser};
use reqwest::{ClientBuilder, Url};
use sql::{frontend, parser::Parser};
use sqlness::{Database, QueryContext};

const SERVER_GRPC_ENDPOINT_ENV: &str = "CERESDB_SERVER_GRPC_ENDPOINT";
Expand Down
4 changes: 2 additions & 2 deletions interpreters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ df_operator = { workspace = true }
log = { workspace = true }
meta_client = { workspace = true }
query_engine = { workspace = true }
query_frontend = { workspace = true }
regex = "1"
snafu = { workspace = true }
sql = { workspace = true }
table_engine = { workspace = true }

[dev-dependencies]
analytic_engine = { workspace = true, features = ["test"] }
catalog_impls = { workspace = true }
sql = { workspace = true, features = ["test"] }
query_frontend = { workspace = true, features = ["test"] }
tokio = { workspace = true }
4 changes: 2 additions & 2 deletions interpreters/src/alter_table.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Interpreter for insert statement

Expand All @@ -8,8 +8,8 @@ use common_types::{
schema::{self, Schema},
};
use common_util::define_result;
use query_frontend::plan::{AlterTableOperation, AlterTablePlan};
use snafu::{ensure, ResultExt, Snafu};
use sql::plan::{AlterTableOperation, AlterTablePlan};
use table_engine::table::AlterSchemaRequest;

use crate::interpreter::{self, AlterTable, Interpreter, InterpreterPtr, Output};
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/create.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Interpreter for create statements

use async_trait::async_trait;
use query_frontend::plan::CreateTablePlan;
use snafu::{ResultExt, Snafu};
use sql::plan::CreateTablePlan;
use table_engine::engine::TableEngineRef;

use crate::{
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/describe.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

use std::{convert::TryInto, sync::Arc};

Expand All @@ -9,8 +9,8 @@ use arrow::{
};
use async_trait::async_trait;
use query_engine::executor::RecordBatchVec;
use query_frontend::plan::DescribeTablePlan;
use snafu::{ResultExt, Snafu};
use sql::plan::DescribeTablePlan;
use table_engine::table::TableRef;

use crate::interpreter::{
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/drop.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Interpreter for drop statements

use async_trait::async_trait;
use query_frontend::plan::DropTablePlan;
use snafu::{ResultExt, Snafu};
use sql::plan::DropTablePlan;
use table_engine::engine::TableEngineRef;

use crate::{
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/exists.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

use std::{convert::TryInto, sync::Arc};

Expand All @@ -9,8 +9,8 @@ use arrow::{
};
use async_trait::async_trait;
use query_engine::executor::RecordBatchVec;
use query_frontend::plan::ExistsTablePlan;
use snafu::{ResultExt, Snafu};
use sql::plan::ExistsTablePlan;

use crate::interpreter::{
Exists, Interpreter, InterpreterPtr, Output, Result as InterpreterResult,
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/factory.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Interpreter factory

use catalog::manager::ManagerRef;
use query_engine::executor::Executor;
use sql::plan::Plan;
use query_frontend::plan::Plan;
use table_engine::engine::TableEngineRef;

use crate::{
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/insert.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Interpreter for insert statement

Expand Down Expand Up @@ -28,8 +28,8 @@ use datafusion::{
},
};
use df_operator::visitor::find_columns_by_expr;
use query_frontend::plan::InsertPlan;
use snafu::{OptionExt, ResultExt, Snafu};
use sql::plan::InsertPlan;
use table_engine::table::{TableRef, WriteRequest};

use crate::{
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/select.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Interpreter for select statement

use async_trait::async_trait;
use log::debug;
use query_engine::executor::{Executor, Query};
use query_frontend::plan::QueryPlan;
use snafu::{ResultExt, Snafu};
use sql::plan::QueryPlan;

use crate::{
context::Context,
Expand Down
8 changes: 4 additions & 4 deletions interpreters/src/show.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

use std::{convert::TryInto, sync::Arc};

Expand All @@ -9,12 +9,12 @@ use arrow::{
};
use async_trait::async_trait;
use catalog::{manager::ManagerRef, schema::Schema, Catalog};
use regex::Regex;
use snafu::{Backtrace, OptionExt, ResultExt, Snafu};
use sql::{
use query_frontend::{
ast::ShowCreateObject,
plan::{QueryType, ShowCreatePlan, ShowPlan, ShowTablesPlan},
};
use regex::Regex;
use snafu::{Backtrace, OptionExt, ResultExt, Snafu};

use crate::{
context::Context,
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/show_create.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

use std::{collections::HashMap, convert::TryInto, sync::Arc};

Expand All @@ -11,8 +11,8 @@ use datafusion::logical_expr::Expr;
use datafusion_proto::bytes::Serializeable;
use log::error;
use query_engine::executor::RecordBatchVec;
use query_frontend::{ast::ShowCreateObject, plan::ShowCreatePlan};
use snafu::ensure;
use sql::{ast::ShowCreateObject, plan::ShowCreatePlan};
use table_engine::{partition::PartitionInfo, table::TableRef};

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion interpreters/src/table_manipulator/catalog_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use catalog::{
table_operator::TableOperator,
};
use common_types::table::DEFAULT_SHARD_ID;
use query_frontend::plan::{CreateTablePlan, DropTablePlan};
use snafu::{ensure, ResultExt};
use sql::plan::{CreateTablePlan, DropTablePlan};
use table_engine::engine::{TableEngineRef, TableState};

use crate::{
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/table_manipulator/meta_based.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

use async_trait::async_trait;
use common_types::schema::SchemaEncoder;
Expand All @@ -8,8 +8,8 @@ use meta_client::{
types::{CreateTableRequest, DropTableRequest, PartitionTableInfo},
MetaClientRef,
};
use query_frontend::plan::{CreateTablePlan, DropTablePlan};
use snafu::ResultExt;
use sql::plan::{CreateTablePlan, DropTablePlan};
use table_engine::{
engine::TableEngineRef,
partition::{format_sub_partition_table_name, PartitionInfo},
Expand Down
2 changes: 1 addition & 1 deletion interpreters/src/table_manipulator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::sync::Arc;

use async_trait::async_trait;
use common_util::error::GenericError;
use query_frontend::plan::{CreateTablePlan, DropTablePlan};
use snafu::{Backtrace, Snafu};
use sql::plan::{CreateTablePlan, DropTablePlan};
use table_engine::engine::TableEngineRef;

use crate::{context::Context, interpreter::Output};
Expand Down
2 changes: 1 addition & 1 deletion interpreters/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use catalog::{
use catalog_impls::table_based::TableBasedManager;
use common_types::request_id::RequestId;
use query_engine::{executor::ExecutorImpl, Config as QueryConfig};
use sql::{
use query_frontend::{
parser::Parser, plan::Plan, planner::Planner, provider::MetaProvider, tests::MockMetaProvider,
};
use table_engine::engine::TableEngineRef;
Expand Down
4 changes: 2 additions & 2 deletions interpreters/src/validator.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

use sql::plan::{Plan, ShowPlan};
use query_frontend::plan::{Plan, ShowPlan};
use table_engine::partition;

use crate::interpreter::{PermissionDenied, Result};
Expand Down
2 changes: 1 addition & 1 deletion query_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ df_operator = { workspace = true }
futures = { workspace = true }
iox_query = { git = "https://github.com/CeresDB/influxql" }
log = { workspace = true }
query_frontend = { workspace = true }
serde = { workspace = true }
snafu = { workspace = true }
sql = { workspace = true }
table_engine = { workspace = true }
tokio = { workspace = true }
Loading