Skip to content

fix: cap sort preserving merge statistics by fetch - #13

Merged
waynexia merged 1 commit into
GreptimeTeam:greptimedb-53.1.0-function-signature-exec-errorfrom
discord9:fix/spm-fetch-statistics-greptimedb-53
Jul 7, 2026
Merged

fix: cap sort preserving merge statistics by fetch#13
waynexia merged 1 commit into
GreptimeTeam:greptimedb-53.1.0-function-signature-exec-errorfrom
discord9:fix/spm-fetch-statistics-greptimedb-53

Conversation

@discord9

@discord9 discord9 commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • Cap SortPreservingMergeExec statistics by its fetch limit so top-k/scalar sides expose their small row count to physical optimizers
  • Preserve no-limit statistics and avoid zeroing byte-size estimates when row count is unknown
  • Add regression coverage for JoinSelection swapping an SPM(fetch=1) side to the hash join build side

Testing

  • cargo test -p datafusion-common test_with_fetch
  • cargo test -p datafusion-physical-plan sort_preserving_merge
  • cargo test -p datafusion join_selection --test core_integration
  • cargo check -p datafusion --test core_integration
  • cargo fmt --all -- --check

Notes

  • cargo clippy --all-targets --all-features -- -D warnings currently fails on unrelated existing 53-branch lints in datafusion/common/src/hash_utils.rs, pruning.rs, scalar/mod.rs, and error.rs; this patch does not touch those files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants