Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Sort from Expr #12193

Closed
findepi opened this issue Aug 27, 2024 · 1 comment · Fixed by #12177
Closed

Remove Sort from Expr #12193

findepi opened this issue Aug 27, 2024 · 1 comment · Fixed by #12177
Assignees

Comments

@findepi
Copy link
Member

findepi commented Aug 27, 2024

There are other Expr variants that only make sense in certain contexts as well. We can't have an Expr::Sort in a projection, for example.

That's a good point and good example. To me, in ORDER BY <expr> [ASC/DESC] [NULLS FIRST/LAST], the <expr> part is an expression (any expression), and the other attributes (asc/desc, nulls first/last) are attributes of the sorting. They don't have to be modeled as "an expression".

I think Sort would be an easier thing to remove / fix -- Expr::Sort as an expression is also bad as it means the signatures of fn order_by(...) are in terms of Expr, meaning the compiler can't ensure you are actually passing Expr::Sort when needed

Originally posted by @alamb in #1468 (comment)

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 a pull request may close this issue.

1 participant