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


##########
datafusion/core/tests/physical_optimizer/limited_distinct_aggregation.rs:
##########
@@ -162,24 +173,31 @@ async fn test_single_global() -> Result<()> {
         Some(3), // fetch
     );
     // expected to push the skip+fetch limit to the AggregateExec
-    let expected = [
-        "GlobalLimitExec: skip=1, fetch=3",
-        "AggregateExec: mode=Single, gby=[a@0 as a], aggr=[], lim=[4]",
-        "DataSourceExec: partitions=1, partition_sizes=[1]",
-    ];
     let plan: Arc<dyn ExecutionPlan> = Arc::new(limit_exec);
-    assert_plan_matches_expected(&plan, &expected)?;
-    let expected = r#"
-+---+
-| a |
-+---+
-| 2 |
-|   |
-| 4 |
-+---+
-"#
-    .trim();
-    assert_results_match_expected(plan, expected).await?;
+    let formatted = get_optimized_plan(&plan)?;
+    let actual = formatted.trim();
+    assert_snapshot!(
+        actual,
+        @r"
+    GlobalLimitExec: skip=1, fetch=3
+      AggregateExec: mode=Single, gby=[a@0 as a], aggr=[], lim=[4]
+        DataSourceExec: partitions=1, partition_sizes=[1]
+    "
+    );
+    let expected = run_plan_and_format(plan).await?;
+    let actual = expected.trim();

Review Comment:
   do you want to put trim inside `run_plan_and_format`?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to