Skip to content

Commit

Permalink
chore: move SanityChecker into physical-optimizer crate (#14083)
Browse files Browse the repository at this point in the history
* chore: move  into  crate

* chore: move SanityChecker tests out to datafusion/core/tests

* chore: update datafusion-cli/Cargo.lock

* fix cargo doc

---------

Co-authored-by: Andrew Lamb <[email protected]>
  • Loading branch information
mnpw and alamb authored Jan 16, 2025
1 parent 5fa8b3b commit e8ad5e5
Show file tree
Hide file tree
Showing 15 changed files with 1,187 additions and 1,125 deletions.
4 changes: 4 additions & 0 deletions datafusion-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ async-trait = { workspace = true }
criterion = { version = "0.5", features = ["async_tokio"] }
ctor = { workspace = true }
datafusion-functions-window-common = { workspace = true }
datafusion-physical-optimizer = { workspace = true }
doc-comment = { workspace = true }
env_logger = { workspace = true }
paste = "^1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1416,9 +1416,6 @@ pub(crate) mod tests {
use crate::datasource::object_store::ObjectStoreUrl;
use crate::datasource::physical_plan::{CsvExec, FileScanConfig, ParquetExec};
use crate::physical_optimizer::enforce_sorting::EnforceSorting;
use crate::physical_optimizer::test_utils::{
check_integrity, coalesce_partitions_exec, repartition_exec,
};
use crate::physical_plan::coalesce_batches::CoalesceBatchesExec;
use crate::physical_plan::expressions::col;
use crate::physical_plan::filter::FilterExec;
Expand All @@ -1427,6 +1424,9 @@ pub(crate) mod tests {
use crate::physical_plan::sorts::sort::SortExec;
use crate::physical_plan::{displayable, DisplayAs, DisplayFormatType, Statistics};
use datafusion_physical_optimizer::output_requirements::OutputRequirements;
use datafusion_physical_optimizer::test_utils::{
check_integrity, coalesce_partitions_exec, repartition_exec,
};

use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
use datafusion_common::ScalarValue;
Expand Down
16 changes: 8 additions & 8 deletions datafusion/core/src/physical_optimizer/enforce_sorting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,17 +658,17 @@ fn get_sort_exprs(
mod tests {
use super::*;
use crate::physical_optimizer::enforce_distribution::EnforceDistribution;
use crate::physical_optimizer::test_utils::{
aggregate_exec, bounded_window_exec, check_integrity, coalesce_batches_exec,
coalesce_partitions_exec, filter_exec, global_limit_exec, hash_join_exec,
limit_exec, local_limit_exec, memory_exec, parquet_exec, parquet_exec_sorted,
repartition_exec, sort_exec, sort_expr, sort_expr_options, sort_merge_join_exec,
sort_preserving_merge_exec, spr_repartition_exec, union_exec,
RequirementsTestExec,
};
use crate::physical_optimizer::test_utils::{parquet_exec, parquet_exec_sorted};
use crate::physical_plan::{displayable, get_plan_string, Partitioning};
use crate::prelude::{SessionConfig, SessionContext};
use crate::test::{csv_exec_ordered, csv_exec_sorted, stream_exec_ordered};
use datafusion_physical_optimizer::test_utils::{
aggregate_exec, bounded_window_exec, check_integrity, coalesce_batches_exec,
coalesce_partitions_exec, filter_exec, global_limit_exec, hash_join_exec,
limit_exec, local_limit_exec, memory_exec, repartition_exec, sort_exec,
sort_expr, sort_expr_options, sort_merge_join_exec, sort_preserving_merge_exec,
spr_repartition_exec, union_exec, RequirementsTestExec,
};

use arrow::compute::SortOptions;
use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
Expand Down
1 change: 0 additions & 1 deletion datafusion/core/src/physical_optimizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub mod enforce_sorting;
pub mod optimizer;
pub mod projection_pushdown;
pub mod replace_with_order_preserving_variants;
pub mod sanity_checker;
#[cfg(test)]
pub mod test_utils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ mod tests {
use super::*;

use crate::execution::TaskContext;
use crate::physical_optimizer::test_utils::check_integrity;
use crate::physical_plan::coalesce_batches::CoalesceBatchesExec;
use crate::physical_plan::filter::FilterExec;
use crate::physical_plan::joins::{HashJoinExec, PartitionMode};
Expand All @@ -296,6 +295,7 @@ mod tests {
};
use crate::prelude::{SessionConfig, SessionContext};
use crate::test::TestStreamPartition;
use datafusion_physical_optimizer::test_utils::check_integrity;

use arrow::array::{ArrayRef, Int32Array};
use arrow::compute::SortOptions;
Expand Down
Loading

0 comments on commit e8ad5e5

Please sign in to comment.