Skip to content

Move EnforceDistribution into datafusion-physical-optimizer crate #14190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1f12ffe
moving enforce_distribution
logan-keede Jan 18, 2025
b58f9d6
formatting fix
logan-keede Jan 18, 2025
0d571a7
Update Cargo.toml
logan-keede Jan 18, 2025
24ab913
pulll source
logan-keede Jan 19, 2025
a7f8927
move_tests to core integration tests
logan-keede Jan 19, 2025
0296d04
remove tests from enforce_distribution.rs
logan-keede Jan 20, 2025
1d94407
Merge branch 'move_crates' of https://github.com/logan-keede/datafusi…
logan-keede Jan 20, 2025
7cd4b31
passes lint
buraksenn Jan 20, 2025
eb8ac39
forgotten license header
buraksenn Jan 20, 2025
8103f00
move enforce_sorting
logan-keede Jan 20, 2025
460c92d
merge main
buraksenn Jan 21, 2025
fef3c6e
import order
buraksenn Jan 21, 2025
7c1dad6
Merge branch 'move-enforce-sorting-to-new-crate' of https://github.co…
logan-keede Jan 21, 2025
dcbc0e1
merge fixes + formatting
logan-keede Jan 21, 2025
1f116e4
fix: forgotten license
logan-keede Jan 21, 2025
5093e61
fix: cargo fmt
logan-keede Jan 21, 2025
9c40e49
fix tests
buraksenn Jan 21, 2025
3d78ef2
Merge branch 'move-enforce-sorting-to-new-crate' of https://github.co…
logan-keede Jan 21, 2025
9d19863
fix: ci tests
logan-keede Jan 21, 2025
eba718a
fix: Cargo.toml formatting
logan-keede Jan 21, 2025
8926f90
Merge branch 'apache_main' into move_crates
berkaysynnada Jan 22, 2025
afb20f8
further removals
berkaysynnada Jan 22, 2025
f04332d
Further migrations and simplificaitons
berkaysynnada Jan 22, 2025
20d47d3
Fix failing tests
berkaysynnada Jan 22, 2025
b13ba8e
Final pass
berkaysynnada Jan 22, 2025
9e1dfbb
Update datafusion-testing
berkaysynnada Jan 22, 2025
b7373fb
Update test_utils.rs
berkaysynnada Jan 22, 2025
a8fe5ca
fix the dep
berkaysynnada Jan 22, 2025
99a419f
Update Cargo.toml
berkaysynnada Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions datafusion-cli/Cargo.lock

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

2 changes: 1 addition & 1 deletion datafusion-testing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datafusion-testing is using the commit: 36283d195c728f26b16b517ba999fd62509b6649 (https://github.com/apache/datafusion-testing/commits/36283d195c728f26b16b517ba999fd62509b6649/)

Submodule datafusion-testing updated 44 files
+4 −12 data/sqlite/random/expr/slt_good_102.slt
+2 −6 data/sqlite/random/expr/slt_good_104.slt
+2 −6 data/sqlite/random/expr/slt_good_105.slt
+2 −6 data/sqlite/random/expr/slt_good_108.slt
+2 −6 data/sqlite/random/expr/slt_good_111.slt
+2 −6 data/sqlite/random/expr/slt_good_113.slt
+2 −6 data/sqlite/random/expr/slt_good_114.slt
+5 −6 data/sqlite/random/expr/slt_good_118.slt
+2 −6 data/sqlite/random/expr/slt_good_12.slt
+2 −6 data/sqlite/random/expr/slt_good_14.slt
+2 −6 data/sqlite/random/expr/slt_good_15.slt
+4 −12 data/sqlite/random/expr/slt_good_21.slt
+2 −6 data/sqlite/random/expr/slt_good_22.slt
+4 −12 data/sqlite/random/expr/slt_good_24.slt
+11 −31 data/sqlite/random/expr/slt_good_28.slt
+4 −12 data/sqlite/random/expr/slt_good_30.slt
+2 −6 data/sqlite/random/expr/slt_good_36.slt
+3 −7 data/sqlite/random/expr/slt_good_38.slt
+5 −6 data/sqlite/random/expr/slt_good_39.slt
+2 −6 data/sqlite/random/expr/slt_good_4.slt
+10 −12 data/sqlite/random/expr/slt_good_41.slt
+2 −6 data/sqlite/random/expr/slt_good_42.slt
+2 −6 data/sqlite/random/expr/slt_good_45.slt
+2 −6 data/sqlite/random/expr/slt_good_46.slt
+2 −6 data/sqlite/random/expr/slt_good_48.slt
+2 −6 data/sqlite/random/expr/slt_good_50.slt
+3 −7 data/sqlite/random/expr/slt_good_52.slt
+2 −6 data/sqlite/random/expr/slt_good_53.slt
+4 −12 data/sqlite/random/expr/slt_good_64.slt
+5 −6 data/sqlite/random/expr/slt_good_66.slt
+2 −6 data/sqlite/random/expr/slt_good_68.slt
+6 −7 data/sqlite/random/expr/slt_good_7.slt
+7 −19 data/sqlite/random/expr/slt_good_72.slt
+6 −7 data/sqlite/random/expr/slt_good_73.slt
+2 −6 data/sqlite/random/expr/slt_good_78.slt
+2 −6 data/sqlite/random/expr/slt_good_80.slt
+8 −13 data/sqlite/random/expr/slt_good_81.slt
+2 −6 data/sqlite/random/expr/slt_good_82.slt
+5 −13 data/sqlite/random/expr/slt_good_85.slt
+2 −6 data/sqlite/random/expr/slt_good_88.slt
+2 −6 data/sqlite/random/expr/slt_good_94.slt
+2 −6 data/sqlite/random/expr/slt_good_95.slt
+1 −5 data/sqlite/random/groupby/slt_good_11.slt
+9 −21 data/sqlite/random/groupby/slt_good_12.slt
4,662 changes: 0 additions & 4,662 deletions datafusion/core/src/physical_optimizer/enforce_distribution.rs

This file was deleted.

2,587 changes: 0 additions & 2,587 deletions datafusion/core/src/physical_optimizer/enforce_sorting.rs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dup with: https://github.com/apache/datafusion/pull/14219/files and #14219 is ready to merge. Maybe you can do a rebase after it merges.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dup with: https://github.com/apache/datafusion/pull/14219/files and #14219 is ready to merge. Maybe you can do a rebase after it merges.

I'll get these PR's, and resolve any conflicts.

This file was deleted.

8 changes: 0 additions & 8 deletions datafusion/core/src/physical_optimizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@
//!
//! [`ExecutionPlan`]: crate::physical_plan::ExecutionPlan

pub mod enforce_distribution;
pub mod enforce_sorting;
pub mod optimizer;
pub mod projection_pushdown;
pub mod replace_with_order_preserving_variants;
#[cfg(test)]
pub mod test_utils;

mod sort_pushdown;
mod utils;

pub use datafusion_physical_optimizer::*;

This file was deleted.

54 changes: 0 additions & 54 deletions datafusion/core/src/physical_optimizer/test_utils.rs

This file was deleted.

95 changes: 0 additions & 95 deletions datafusion/core/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,13 @@ use crate::datasource::physical_plan::{CsvExec, FileScanConfig};
use crate::datasource::{MemTable, TableProvider};
use crate::error::Result;
use crate::logical_expr::LogicalPlan;
use crate::physical_plan::ExecutionPlan;
use crate::test::object_store::local_unpartitioned_file;
use crate::test_util::{aggr_test_schema, arrow_test_data};

use arrow::array::{self, Array, ArrayRef, Decimal128Builder, Int32Array};
use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
use arrow::record_batch::RecordBatch;
use datafusion_common::DataFusionError;
use datafusion_execution::{SendableRecordBatchStream, TaskContext};
use datafusion_physical_expr::PhysicalSortExpr;
use datafusion_physical_plan::streaming::{PartitionStream, StreamingTableExec};

#[cfg(feature = "compression")]
use bzip2::write::BzEncoder;
Expand Down Expand Up @@ -290,96 +286,5 @@ fn make_decimal() -> RecordBatch {
RecordBatch::try_new(Arc::new(schema), vec![Arc::new(array)]).unwrap()
}

/// Created a sorted Csv exec
pub fn csv_exec_sorted(
schema: &SchemaRef,
sort_exprs: impl IntoIterator<Item = PhysicalSortExpr>,
) -> Arc<dyn ExecutionPlan> {
let sort_exprs = sort_exprs.into_iter().collect();

Arc::new(
CsvExec::builder(
FileScanConfig::new(
ObjectStoreUrl::parse("test:///").unwrap(),
schema.clone(),
)
.with_file(PartitionedFile::new("x".to_string(), 100))
.with_output_ordering(vec![sort_exprs]),
)
.with_has_header(false)
.with_delimeter(0)
.with_quote(0)
.with_escape(None)
.with_comment(None)
.with_newlines_in_values(false)
.with_file_compression_type(FileCompressionType::UNCOMPRESSED)
.build(),
)
}

// construct a stream partition for test purposes
#[derive(Debug)]
pub(crate) struct TestStreamPartition {
pub schema: SchemaRef,
}

impl PartitionStream for TestStreamPartition {
fn schema(&self) -> &SchemaRef {
&self.schema
}
fn execute(&self, _ctx: Arc<TaskContext>) -> SendableRecordBatchStream {
unreachable!()
}
}

/// Create an unbounded stream exec
pub fn stream_exec_ordered(
schema: &SchemaRef,
sort_exprs: impl IntoIterator<Item = PhysicalSortExpr>,
) -> Arc<dyn ExecutionPlan> {
let sort_exprs = sort_exprs.into_iter().collect();

Arc::new(
StreamingTableExec::try_new(
schema.clone(),
vec![Arc::new(TestStreamPartition {
schema: schema.clone(),
}) as _],
None,
vec![sort_exprs],
true,
None,
)
.unwrap(),
)
}

/// Create a csv exec for tests
pub fn csv_exec_ordered(
schema: &SchemaRef,
sort_exprs: impl IntoIterator<Item = PhysicalSortExpr>,
) -> Arc<dyn ExecutionPlan> {
let sort_exprs = sort_exprs.into_iter().collect();

Arc::new(
CsvExec::builder(
FileScanConfig::new(
ObjectStoreUrl::parse("test:///").unwrap(),
schema.clone(),
)
.with_file(PartitionedFile::new("file_path".to_string(), 100))
.with_output_ordering(vec![sort_exprs]),
)
.with_has_header(true)
.with_delimeter(0)
.with_quote(b'"')
.with_escape(None)
.with_comment(None)
.with_newlines_in_values(false)
.with_file_compression_type(FileCompressionType::UNCOMPRESSED)
.build(),
)
}

pub mod object_store;
pub mod variable;
Loading
Loading