Skip to content

help: workaround for WHERE clause cannot contain window functions #6952

Answered by cpcloud
NickCrews asked this question in Q&A
Discussion options

You must be logged in to vote

I think we'll have a solution for this soon™️

sqlglot supports transforming QUALIFY into WHERE (this is only important for some backends), but we need a way in ibis to represent a predicate that should be compiled into a QUALIFY clause. We may be able to do this with an internal-only ops.Value, or by partitioning predicates into a new qualify field on ops.Selection.

From there, sqlglot will compile either to QUALIFY if the backend supports it, or the equivalent projection + WHERE similar to what dplyr is doing.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@cpcloud
Comment options

Comment options

You must be logged in to vote
1 reply
@NickCrews
Comment options

NickCrews Sep 28, 2023
Maintainer Author

Answer selected by NickCrews
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants