Skip to content

Disallow order by within ordered-set aggregate functions argument lists#20421

Open
cj-zhukov wants to merge 1 commit intoapache:mainfrom
cj-zhukov:cj-zhukov/disallow-order-by-within-ordered-set-agr-fn-arg-lists
Open

Disallow order by within ordered-set aggregate functions argument lists#20421
cj-zhukov wants to merge 1 commit intoapache:mainfrom
cj-zhukov:cj-zhukov/disallow-order-by-within-ordered-set-agr-fn-arg-lists

Conversation

@cj-zhukov
Copy link
Contributor

@cj-zhukov cj-zhukov commented Feb 18, 2026

Which issue does this PR close?

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Feb 18, 2026
@cj-zhukov
Copy link
Contributor Author

High-level overview

This PR fixes incorrect handling of ordered-set aggregate syntax.

Specifically:

  • Updated datafusion/sql/src/expr/function.rs to return a planning error when ORDER BY is used inline
  • Added test coverage in datafusion/sqllogictest/test_files/aggregate.slt to ensure these invalid forms now return a syntax/planning error

@cj-zhukov
Copy link
Contributor Author

@Jefffrey Since you originally opened this issue, could you please take a look at the proposed refactor?

@Jefffrey Jefffrey changed the title Disallow order by within ordered-set aggregate functions argument lis… Disallow order by within ordered-set aggregate functions argument lists Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments