Skip to content

Commit a0e6d69

Browse files
author
Cheng-Yuan-Lai
committed
feat: remove the change of enforce_sorting to another branch
1 parent 267ec54 commit a0e6d69

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

datafusion/core/tests/physical_optimizer/enforce_sorting.rs

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -220,35 +220,16 @@ async fn test_remove_unnecessary_sort5() -> Result<()> {
220220
)];
221221
let join = hash_join_exec(left_input, right_input, on, None, &JoinType::Inner)?;
222222
let physical_plan = sort_exec(vec![sort_expr("a", &join.schema())], join);
223-
let mut config = ConfigOptions::new();
224-
config.optimizer.repartition_sorts = true;
225-
let optimized_physical_plan =
226-
EnforceSorting::new().optimize(physical_plan.clone(), &config)?;
227-
let plan_formatted = displayable(physical_plan.as_ref()).indent(true).to_string();
228-
let optimized_plan_formatted = displayable(optimized_physical_plan.as_ref())
229-
.indent(true)
230-
.to_string();
231-
let actual = plan_formatted.trim();
232-
let optimized_actual = optimized_plan_formatted.trim();
233-
234-
// let expected_input = ["SortExec: expr=[a@2 ASC], preserve_partitioning=[false]",
235-
// " HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]",
236-
// " DataSourceExec: partitions=1, partition_sizes=[0]",
237-
// " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet"];
238-
239-
// let expected_optimized = ["HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]",
240-
// " DataSourceExec: partitions=1, partition_sizes=[0]",
241-
// " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet"];
242-
// assert_optimized!(expected_input, expected_optimized, physical_plan, true);
243-
assert_snapshot!(
244-
actual,
245-
@""
246-
);
247223

248-
assert_snapshot!(
249-
optimized_actual,
250-
@""
251-
);
224+
let expected_input = ["SortExec: expr=[a@2 ASC], preserve_partitioning=[false]",
225+
" HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]",
226+
" DataSourceExec: partitions=1, partition_sizes=[0]",
227+
" DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet"];
228+
229+
let expected_optimized = ["HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]",
230+
" DataSourceExec: partitions=1, partition_sizes=[0]",
231+
" DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet"];
232+
assert_optimized!(expected_input, expected_optimized, physical_plan, true);
252233

253234
Ok(())
254235
}

0 commit comments

Comments
 (0)