Skip to content

Commit

Permalink
fixup! Move analyzer out of optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Oct 2, 2024
1 parent 690fb97 commit 4b12aac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions datafusion/sql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mod relation;
mod select;
mod set_expr;
mod statement;
#[cfg(test)]
mod test;
#[cfg(feature = "unparser")]
pub mod unparser;
Expand Down
14 changes: 6 additions & 8 deletions datafusion/sql/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,25 @@ 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<LogicalPlan> {
pub fn test_table_scan() -> datafusion_common::Result<LogicalPlan> {
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<LogicalPlan> {
pub fn test_table_scan_with_name(name: &str) -> datafusion_common::Result<LogicalPlan> {
let schema = Schema::new(test_table_scan_fields());
table_scan(Some(name), &schema, None)?.build()
}

pub(crate) fn test_table_scan_fields() -> Vec<Field> {
pub fn test_table_scan_fields() -> Vec<Field> {
vec![
Field::new("a", DataType::UInt32, false),
Field::new("b", DataType::UInt32, false),
Field::new("c", DataType::UInt32, false),
]
}

pub(crate) fn assert_analyzed_plan_eq(
pub fn assert_analyzed_plan_eq(
rule: Arc<dyn AnalyzerRule + Send + Sync>,
plan: LogicalPlan,
expected: &str,
Expand All @@ -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<dyn AnalyzerRule + Send + Sync>,
plan: LogicalPlan,
Expand All @@ -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<dyn AnalyzerRule + Send + Sync>,
plan: LogicalPlan,
expected: &str,
Expand Down

0 comments on commit 4b12aac

Please sign in to comment.