fix(ffi): route partition statistics through statistics_with_args#2
Open
alamb wants to merge 1 commit into
Open
Conversation
alamb
commented
Jun 8, 2026
| fn test_ffi_execution_plan_partition_statistics_round_trip() -> Result<()> { | ||
| /// Build an `EmptyExec` carrying `statistics`, then export it across the | ||
| /// (mock) FFI boundary and return the resulting foreign plan. | ||
| #[cfg(test)] |
Author
There was a problem hiding this comment.
Refactored out into a common fixture so I could avoid a copy/pasta version of the test that was hard to understand what was different
| let with_stats = | ||
| export_empty_exec_over_ffi(&schema, Some(original_stats.clone()))?; | ||
| assert_eq!( | ||
| with_stats.partition_statistics(None)?.as_ref(), |
| export_empty_exec_over_ffi(&schema, Some(original_stats.clone()))?; | ||
| assert_eq!( | ||
| with_stats | ||
| .statistics_with_args(&StatisticsArgs::new(None))? |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Targets apache#21815 (the
StatisticsContext/statistics_with_argsPR). This is a follow-up fix to land on that branch before it merges.Rationale for this change
apache#21815 deprecates
ExecutionPlan::partition_statisticsand migrates every in-tree operator (DataSourceExec,FilterExec,UnionExec, joins, aggregates, …) to override only the newstatistics_with_args.The FFI wrapper (
partition_statistics_fn_wrapper) still called the deprecatedpartition_statistics. So if anyone upgraded their nodes to use the new function, the FFI bindings still would call the deprecated versionWhat changes are included in this PR?
Are these changes tested?
Yes locally
Are there any user-facing changes?
No public API change beyond the upgrade-guide note. Fixes a silent statistics regression for FFI-exported plans.
Disclaimer: I used AI to assist in preparing this change; I have reviewed the output and it matches my intention.