You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "viirya (via GitHub)" <gi...@apache.org> on 2026/09/19 22:09:09 UTC
[PR] fix: validate trailing ORDER BY keys in free RANGE frames [datafusion]
viirya opened a new pull request, #25518:
URL: https://github.com/apache/datafusion/pull/25518
## Which issue does this PR close?
- Closes #<issue-number>.
## Rationale for this change
A free `RANGE` window frame determines peers using every `ORDER BY`
expression. However, when the first expression had an offset target type, the
analyzer did not validate the remaining expressions.
Consequently, an unsupported trailing `Map` expression could reach execution
and rows with different map values could incorrectly be treated as peers.
## What changes are included in this PR?
Validate all trailing `ORDER BY` expressions when the first expression
establishes the RANGE target type.
This preserves the existing behavior that accepts a `List` as the first
`ORDER BY` expression, while rejecting unsupported trailing expressions.
A SQL logic regression test for `ORDER BY int_col, map_col` is included.
## What is the testing strategy for this PR?
- Added a regression test in `window.slt`.
- Verified that the old code returns incorrect peer counts while the fixed
code reports a planning error.
- Verified existing first-`List` and supported multi-key cases.
- Ran `cargo fmt --all -- --check`.
- Ran `cargo clippy -p datafusion-optimizer --all-targets --all-features -- -D warnings`.
## Are there any user-facing changes?
Yes. Free `RANGE` frames with an unsupported trailing `ORDER BY` type are now
rejected during planning instead of potentially producing incorrect results.
There are no public API changes.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: validate trailing ORDER BY keys in free RANGE frames [datafusion]
Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya merged PR #25518:
URL: https://github.com/apache/datafusion/pull/25518
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: validate trailing ORDER BY keys in free RANGE frames [datafusion]
Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on PR #25518:
URL: https://github.com/apache/datafusion/pull/25518#issuecomment-5780087578
Thank you @alamb !
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: validate trailing ORDER BY keys in free RANGE frames [datafusion]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #25518:
URL: https://github.com/apache/datafusion/pull/25518#issuecomment-5745798138
## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/25518?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 82.38%. Comparing base ([`710c748`](https://app.codecov.io/gh/apache/datafusion/commit/710c748db8931bbe28ade5f25436d0672a19b355?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1d62c26`](https://app.codecov.io/gh/apache/datafusion/commit/1d62c26c82c9f584f782c258abc9f66acc89e6ac?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on main.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #25518 +/- ##
==========================================
- Coverage 82.38% 82.38% -0.01%
==========================================
Files 1138 1138
Lines 434313 434313
Branches 434313 434313
==========================================
- Hits 357805 357804 -1
+ Misses 54876 54874 -2
- Partials 21632 21635 +3
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/25518?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: validate trailing ORDER BY keys in free RANGE frames [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #25518:
URL: https://github.com/apache/datafusion/pull/25518#issuecomment-5776027256
Thanks @viirya -- makes sense to me
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org