blaginin commented on code in PR #17900:
URL: https://github.com/apache/datafusion/pull/17900#discussion_r2404115633
##########
datafusion/core/tests/physical_optimizer/enforce_sorting.rs:
##########
@@ -193,19 +328,19 @@ async fn test_remove_unnecessary_sort5() -> Result<()> {
let join = hash_join_exec(left_input, right_input, on, None,
&JoinType::Inner)?;
let physical_plan = sort_exec([sort_expr("a", &join.schema())].into(),
join);
- let expected_input = [
- "SortExec: expr=[a@2 ASC], preserve_partitioning=[false]",
- " HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0,
c@2)]",
- " DataSourceExec: partitions=1, partition_sizes=[0]",
- " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b,
c, d, e], output_ordering=[a@0 ASC], file_type=parquet",
- ];
- let expected_optimized = [
- "HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]",
- " DataSourceExec: partitions=1, partition_sizes=[0]",
- " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c,
d, e], output_ordering=[a@0 ASC], file_type=parquet",
- ];
- assert_optimized!(expected_input, expected_optimized, physical_plan, true);
-
+ let test =
EnforceSortingTest::new(physical_plan).with_repartition_sorts(true);
+ assert_snapshot!(test.run(), @r"
+ Input Plan:
+ SortExec: expr=[a@2 ASC], preserve_partitioning=[false]
+ HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]
+ DataSourceExec: partitions=1, partition_sizes=[0]
+ DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d,
e], output_ordering=[a@0 ASC], file_type=parquet
Review Comment:
this is definitely just a personal preference but I find merged string is
cleaner to follow than array representation with `[]` and `""`.
Before it would make sense, because it'd allow you to copy and paste the
plan - but now this is managed by insta so no need use debug representation in
my opinion
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]