Skip to content

test: add NULL values to Fuzz window - #26386

Merged
alamb merged 3 commits into
apache:mainfrom
Nagato-Yuzuru:fuzz-window-nulls
Oct 19, 2026
Merged

alamb merged 3 commits into
apache:mainfrom
Nagato-Yuzuru:fuzz-window-nulls

Conversation

@Nagato-Yuzuru

Copy link
Copy Markdown
Contributor

Part of #24243.

This PR adds NULL values to the window fuzz test, as planned.

Rationale for this change

The window fuzz test had two gaps:

  • The test data had no NULL values.
  • The test used only one sort order: ASC NULLS FIRST.

With these gaps closed, the test finds wrong results on main. All of them
come from one known error: #25859.

What changes are included in this PR?

  • Add NULL values to the test data. The NULL rate changes between 0, 0.01, 0.1
    and 0.5.
  • Give each sort column a random sort direction and a random NULL position.

Note: a seed now gives different data than before this PR.

What is the testing strategy for this PR?

cargo test --profile ci -p datafusion --features extended_tests --test fuzz -- window_fuzz

On main, the test fails. For example:

WindowFrame { units: Range, start_bound: Preceding(Int32(6)), end_bound: Preceding(Int32(5)), .. },
window_fn: max(x), random_seed: 267, null_pct: 0.5, pb_cols: ["a"], ..

All failures have a RANGE frame that ends in N PRECEDING, and NULL values in
the data. They occur with all four sort orders (ASC/DESC, NULLS FIRST/LAST).

Additional notes

#25860 fixes #25859. With #25860, this test passes. This PR must merge after
#25860. Or, if the author of #25860 agrees, these commits can go into #25860.

Are there any user-facing changes?

No

@github-actions github-actions Bot added the core Core DataFusion crate label Oct 15, 2026
@Nagato-Yuzuru Nagato-Yuzuru changed the title Fuzz window nulls test: add NULL values to Fuzz window Oct 15, 2026
@codecov-commenter

codecov-commenter commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.89%. Comparing base (fe612e2) to head (20db6e1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26386      +/-   ##
==========================================
- Coverage   82.89%   82.89%   -0.01%     
==========================================
  Files        1154     1154              
  Lines      458022   458022              
  Branches   458022   458022              
==========================================
- Hits       379683   379675       -8     
- Misses      55303    55307       +4     
- Partials    23036    23040       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jayzhan211 jayzhan211 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor issue, could be merge after #25860

The test data now has NULL values. The NULL rate changes between 0,
0.01, 0.1 and 0.5.
Each of the columns 'a', 'b' and 'c' gets a random sort direction and a
random NULL position.
@alamb
alamb added this pull request to the merge queue Oct 19, 2026
@alamb

alamb commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Thank you @Nagato-Yuzuru and @jayzhan211

Merged via the queue into apache:main with commit 91087d4 Oct 19, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate v56.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong results: window aggregates over RANGE ... N PRECEDING depend on batch boundaries when the ORDER BY value is NULL

4 participants