This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new d12797311b Migrate core test to insta part 3 (#16978)
d12797311b is described below
commit d12797311bb53d0d7c30cb93e5014875a17fe2f3
Author: Ian Lai <[email protected]>
AuthorDate: Fri Oct 24 04:16:20 2025 +0800
Migrate core test to insta part 3 (#16978)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Part of #15791 .
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
Related #16324 #16617
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
No
---------
Co-authored-by: Ian Lai <[email protected]>
Co-authored-by: Cheng-Yuan-Lai <a186235@g,ail.com>
Co-authored-by: Andrew Lamb <[email protected]>
Co-authored-by: blaginin <[email protected]>
---
.../physical_optimizer/partition_statistics.rs | 36 ++++++++++++----------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/datafusion/core/tests/physical_optimizer/partition_statistics.rs
b/datafusion/core/tests/physical_optimizer/partition_statistics.rs
index 62ab5cbc42..49dc5b8456 100644
--- a/datafusion/core/tests/physical_optimizer/partition_statistics.rs
+++ b/datafusion/core/tests/physical_optimizer/partition_statistics.rs
@@ -17,6 +17,7 @@
#[cfg(test)]
mod test {
+ use insta::assert_snapshot;
use std::sync::Arc;
use arrow::array::{Int32Array, RecordBatch};
@@ -606,21 +607,21 @@ mod test {
.build()
.map(Arc::new)?];
- let aggregate_exec_partial = Arc::new(AggregateExec::try_new(
- AggregateMode::Partial,
- group_by.clone(),
- aggr_expr.clone(),
- vec![None],
- Arc::clone(&scan),
- scan_schema.clone(),
- )?) as _;
-
- let mut plan_string = get_plan_string(&aggregate_exec_partial);
- let _ = plan_string.swap_remove(1);
- let expected_plan = vec![
- "AggregateExec: mode=Partial, gby=[id@0 as id, 1 + id@0 as expr],
aggr=[COUNT(c)]",
- ];
- assert_eq!(plan_string, expected_plan);
+ let aggregate_exec_partial: Arc<dyn ExecutionPlan> =
+ Arc::new(AggregateExec::try_new(
+ AggregateMode::Partial,
+ group_by.clone(),
+ aggr_expr.clone(),
+ vec![None],
+ Arc::clone(&scan),
+ scan_schema.clone(),
+ )?) as _;
+
+ let plan_string =
get_plan_string(&aggregate_exec_partial).swap_remove(0);
+ assert_snapshot!(
+ plan_string,
+ @"AggregateExec: mode=Partial, gby=[id@0 as id, 1 + id@0 as expr],
aggr=[COUNT(c)]"
+ );
let p0_statistics =
aggregate_exec_partial.partition_statistics(Some(0))?;
@@ -710,7 +711,10 @@ mod test {
)?) as _;
let agg_plan = get_plan_string(&agg_partial).remove(0);
- assert_eq!("AggregateExec: mode=Partial, gby=[id@0 as id, 1 + id@0 as
expr], aggr=[COUNT(c)]",agg_plan);
+ assert_snapshot!(
+ agg_plan,
+ @"AggregateExec: mode=Partial, gby=[id@0 as id, 1 + id@0 as expr],
aggr=[COUNT(c)]"
+ );
let empty_stat = Statistics {
num_rows: Precision::Exact(0),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]