Apache DataFusion SQL Query Engine
ARROW-4892: [Rust] [DataFusion] Move SQL parser and planner into SQL module
Andy Grove1ee06e842bd0
diff --git a/rust/datafusion/src/execution/context.rs b/rust/datafusion/src/execution/context.rsindex b5390847cf..b1ebf40ab3 100644--- a/rust/datafusion/src/execution/context.rs+++ b/rust/datafusion/src/execution/context.rs@@ -27,7 +27,6 @@ use arrow::datatypes::*;use crate::datasource::csv::CsvFile;use crate::datasource::datasource::Table;-use crate::dfparser::{DFASTNode, DFParser};use crate::execution::aggregate::AggregateRelation;use crate::execution::error::{ExecutionError, Result};use crate::execution::expression::*;@@ -38,7 +37,8 @@ use crate::execution::relation::{DataSourceRelation, Relation};use crate::logicalplan::*;use crate::optimizer::optimizer::OptimizerRule;use crate::optimizer::projection_push_down::ProjectionPushDown;-use crate::sqlplanner::{SchemaProvider, SqlToRel};+use crate::sql::parser::{DFASTNode, DFParser};+use crate::sql::planner::{SchemaProvider, SqlToRel};pub struct ExecutionContext {datasources: Rc<RefCell<HashMap<String, Rc<Table>>>>,diff --git a/rust/datafusion/src/lib.rs b/rust/datafusion/src/lib.rsindex 7fab04620e..63f4ab77b2 100644--- a/rust/datafusion/src/lib.rs+++ b/rust/datafusion/src/lib.rs@@ -25,8 +25,7 @@ extern crate serde_json;extern crate sqlparser;pub mod datasource;-pub mod dfparser;pub mod execution;pub mod logicalplan;pub mod optimizer;-pub mod sqlplanner;+pub mod sql;diff --git a/rust/datafusion/src/sql/mod.rs b/rust/datafusion/src/sql/mod.rsnew file mode 100644index 0000000000..77a076788c--- /dev/null+++ b/rust/datafusion/src/sql/mod.rs@@ -0,0 +1,21 @@+// Licensed to the Apache Software Foundation (ASF) under one+// or more contributor license agreements. See the NOTICE file+// distributed with this work for additional information+// regarding copyright ownership. The ASF licenses this file+// to you under the Apache License, Version 2.0 (the+// "License"); you may not use this file except in compliance+// with the License. You may obtain a copy of the License at+//+// http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing,+// software distributed under the License is distributed on an+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY+// KIND, either express or implied. See the License for the+// specific language governing permissions and limitations+// under the License.++//! SQL parser and query planner++pub mod parser;+pub mod planner;diff --git a/rust/datafusion/src/dfparser.rs b/rust/datafusion/src/sql/parser.rssimilarity index 100%rename from rust/datafusion/src/dfparser.rsrename to rust/datafusion/src/sql/parser.rsdiff --git a/rust/datafusion/src/sqlplanner.rs b/rust/datafusion/src/sql/planner.rssimilarity index 99%rename from rust/datafusion/src/sqlplanner.rsrename to rust/datafusion/src/sql/planner.rsindex cc988060c5..a463b4cd49 100644--- a/rust/datafusion/src/sqlplanner.rs+++ b/rust/datafusion/src/sql/planner.rs@@ -21,8 +21,8 @@ use std::collections::HashSet;use std::string::String;use std::sync::Arc;-use super::execution::error::*;-use super::logicalplan::*;+use crate::execution::error::*;+use crate::logicalplan::*;use arrow::datatypes::*;