From 4b12aaccc032ce5fd45e2f6ef84ca1bfb7e79702 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 2 Oct 2024 13:19:26 +0200 Subject: [PATCH] fixup! Move analyzer out of optimizer --- datafusion/sql/src/lib.rs | 1 + datafusion/sql/src/test.rs | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/datafusion/sql/src/lib.rs b/datafusion/sql/src/lib.rs index 049cbf9b62070..b705c175cc3bb 100644 --- a/datafusion/sql/src/lib.rs +++ b/datafusion/sql/src/lib.rs @@ -44,6 +44,7 @@ mod relation; mod select; mod set_expr; mod statement; +#[cfg(test)] mod test; #[cfg(feature = "unparser")] pub mod unparser; diff --git a/datafusion/sql/src/test.rs b/datafusion/sql/src/test.rs index cb98da2ad1cb4..b23626db7dab5 100644 --- a/datafusion/sql/src/test.rs +++ b/datafusion/sql/src/test.rs @@ -22,19 +22,17 @@ use datafusion_expr::{table_scan, LogicalPlan}; use std::sync::Arc; /// some tests share a common table -pub(crate) fn test_table_scan() -> datafusion_common::Result { +pub fn test_table_scan() -> datafusion_common::Result { test_table_scan_with_name("test") } /// some tests share a common table with different names -pub(crate) fn test_table_scan_with_name( - name: &str, -) -> datafusion_common::Result { +pub fn test_table_scan_with_name(name: &str) -> datafusion_common::Result { let schema = Schema::new(test_table_scan_fields()); table_scan(Some(name), &schema, None)?.build() } -pub(crate) fn test_table_scan_fields() -> Vec { +pub fn test_table_scan_fields() -> Vec { vec![ Field::new("a", DataType::UInt32, false), Field::new("b", DataType::UInt32, false), @@ -42,7 +40,7 @@ pub(crate) fn test_table_scan_fields() -> Vec { ] } -pub(crate) fn assert_analyzed_plan_eq( +pub fn assert_analyzed_plan_eq( rule: Arc, plan: LogicalPlan, expected: &str, @@ -53,7 +51,7 @@ pub(crate) fn assert_analyzed_plan_eq( Ok(()) } -pub(crate) fn assert_analyzed_plan_with_config_eq( +pub fn assert_analyzed_plan_with_config_eq( options: ConfigOptions, rule: Arc, plan: LogicalPlan, @@ -67,7 +65,7 @@ pub(crate) fn assert_analyzed_plan_with_config_eq( Ok(()) } -pub(crate) fn assert_analyzed_plan_eq_display_indent( +pub fn assert_analyzed_plan_eq_display_indent( rule: Arc, plan: LogicalPlan, expected: &str,