blaginin commented on code in PR #17900:
URL: https://github.com/apache/datafusion/pull/17900#discussion_r2404115179


##########
datafusion/core/tests/physical_optimizer/enforce_sorting.rs:
##########
@@ -291,15 +434,19 @@ async fn test_union_inputs_different_sorted() -> 
Result<()> {
     let physical_plan = sort_preserving_merge_exec(ordering, union);
 
     // one input to the union is already sorted, one is not.
-    let expected_input = [
-        "SortPreservingMergeExec: [nullable_col@0 ASC]",
-        "  UnionExec",
-        "    DataSourceExec: file_groups={1 group: [[x]]}, 
projection=[nullable_col, non_nullable_col], output_ordering=[nullable_col@0 
ASC, non_nullable_col@1 ASC], file_type=parquet",
-        "    SortExec: expr=[nullable_col@0 ASC], 
preserve_partitioning=[false]",
-        "      DataSourceExec: file_groups={1 group: [[x]]}, 
projection=[nullable_col, non_nullable_col], file_type=parquet",
-    ];
+    let test = EnforceSortingTest::new(physical_plan)
+        .with_repartition_sorts(true)
+        .with_expected_description("// should not add a sort at the output of 
the union, input plan should not be changed")
+        .with_expect_no_change(true);
+    assert_snapshot!(test.run(), @r"
     // should not add a sort at the output of the union, input plan should not 
be changed
-    assert_optimized!(expected_input, expected_input, physical_plan, true);
+    Input / Optimized Plan:

Review Comment:
   if those two are the same, i think there's no need to duplicate the plans - 
so i assert just one



-- 
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]

Reply via email to