You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ag...@apache.org on 2019/03/15 16:58:29 UTC

[arrow] branch master updated: ARROW-4892: [Rust] [DataFusion] Move SQL parser and planner into SQL module

This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 0451b99  ARROW-4892: [Rust] [DataFusion] Move SQL parser and planner into SQL module
0451b99 is described below

commit 0451b9942e1daf7bcd7f20aeb4526eab96d39411
Author: Andy Grove <an...@gmail.com>
AuthorDate: Fri Mar 15 10:58:17 2019 -0600

    ARROW-4892: [Rust] [DataFusion] Move SQL parser and planner into SQL module
    
    There are a few small re-org things I would like to do before we release 0.13.0 and this is one of them.
    
    Author: Andy Grove <an...@gmail.com>
    
    Closes #3916 from andygrove/ARROW-4892 and squashes the following commits:
    
    27e11ef <Andy Grove> Move SQL parser and planner into SQL module
---
 rust/datafusion/src/execution/context.rs              |  4 ++--
 rust/datafusion/src/lib.rs                            |  3 +--
 rust/datafusion/src/{lib.rs => sql/mod.rs}            | 17 +++--------------
 rust/datafusion/src/{dfparser.rs => sql/parser.rs}    |  0
 rust/datafusion/src/{sqlplanner.rs => sql/planner.rs} |  4 ++--
 5 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/rust/datafusion/src/execution/context.rs b/rust/datafusion/src/execution/context.rs
index b539084..b1ebf40 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.rs
index 7fab046..63f4ab7 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/lib.rs b/rust/datafusion/src/sql/mod.rs
similarity index 69%
copy from rust/datafusion/src/lib.rs
copy to rust/datafusion/src/sql/mod.rs
index 7fab046..77a0767 100644
--- a/rust/datafusion/src/lib.rs
+++ b/rust/datafusion/src/sql/mod.rs
@@ -15,18 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 
-//! DataFusion is a modern distributed compute platform implemented in Rust that uses
-//! Apache Arrow as the memory model
+//! SQL parser and query planner
 
-extern crate arrow;
-#[macro_use]
-extern crate serde_derive;
-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 parser;
+pub mod planner;
diff --git a/rust/datafusion/src/dfparser.rs b/rust/datafusion/src/sql/parser.rs
similarity index 100%
rename from rust/datafusion/src/dfparser.rs
rename to rust/datafusion/src/sql/parser.rs
diff --git a/rust/datafusion/src/sqlplanner.rs b/rust/datafusion/src/sql/planner.rs
similarity index 99%
rename from rust/datafusion/src/sqlplanner.rs
rename to rust/datafusion/src/sql/planner.rs
index cc98806..a463b4c 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::*;