diff --git a/datafusion/sql/src/expr/mod.rs b/datafusion/sql/src/expr/mod.rs index 5480c8d1d335d..080e92369695d 100644 --- a/datafusion/sql/src/expr/mod.rs +++ b/datafusion/sql/src/expr/mod.rs @@ -67,7 +67,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { } /// Generate a relational expression from a SQL expression - pub(crate) fn sql_to_rex( + pub fn sql_to_rex( &self, sql: SQLExpr, schema: &DFSchema, diff --git a/datafusion/sql/src/planner.rs b/datafusion/sql/src/planner.rs index 9e158291837fe..80b8d4064a3b6 100644 --- a/datafusion/sql/src/planner.rs +++ b/datafusion/sql/src/planner.rs @@ -394,7 +394,9 @@ mod tests { use sqlparser::dialect::{Dialect, GenericDialect, HiveDialect, MySqlDialect}; - use datafusion_common::assert_contains; + use datafusion_common::{assert_contains, ScalarValue}; + use datafusion_expr::logical_plan::Prepare; + use crate::parser::DFParser; use super::*; diff --git a/datafusion/sql/src/query.rs b/datafusion/sql/src/query.rs index b7cf29138c946..57fd8674ca98c 100644 --- a/datafusion/sql/src/query.rs +++ b/datafusion/sql/src/query.rs @@ -1,3 +1,20 @@ +// 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. + use crate::planner::{ContextProvider, PlannerContext, SqlToRel}; use crate::utils::normalize_ident; use datafusion_common::{DFSchema, DataFusionError, Result, ScalarValue}; diff --git a/datafusion/sql/src/relation/join.rs b/datafusion/sql/src/relation/join.rs index f31039ec7023b..7ee7d01bc7185 100644 --- a/datafusion/sql/src/relation/join.rs +++ b/datafusion/sql/src/relation/join.rs @@ -1,3 +1,20 @@ +// 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. + use crate::planner::{ContextProvider, PlannerContext, SqlToRel}; use crate::utils::normalize_ident; use datafusion_common::{Column, DFSchemaRef, DataFusionError, Result}; diff --git a/datafusion/sql/src/relation/mod.rs b/datafusion/sql/src/relation/mod.rs index 7e0b155ba61a8..852e9afdbf048 100644 --- a/datafusion/sql/src/relation/mod.rs +++ b/datafusion/sql/src/relation/mod.rs @@ -1,3 +1,20 @@ +// 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. + use crate::planner::{ object_name_to_table_reference, ContextProvider, PlannerContext, SqlToRel, }; diff --git a/datafusion/sql/src/statement.rs b/datafusion/sql/src/statement.rs index eaed2448d38ea..b6218c5f5bd91 100644 --- a/datafusion/sql/src/statement.rs +++ b/datafusion/sql/src/statement.rs @@ -1,3 +1,20 @@ +// 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. + use crate::parser::{ CreateExternalTable, DFParser, DescribeTable, Statement as DFStatement, }; @@ -36,7 +53,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { } /// Generate a logical plan from an SQL statement - fn sql_statement_to_plan(&self, statement: Statement) -> Result { + pub fn sql_statement_to_plan(&self, statement: Statement) -> Result { self.sql_statement_to_plan_with_context(statement, &mut PlannerContext::new()) }