-
Notifications
You must be signed in to change notification settings - Fork 174
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
Rethink optimization of ORDER BY #276
Comments
My copy of "SQL-99 complete, really" says" There can be no ORDER BY clause inside the subquery" in fully-conformant DBMSs. I'd prefer to make this into a warning. |
#471 should never emit |
Yeah, I just re-looked at #471 — it seems a bit too risky to me; I'd prefer to make the minimum change to make this work. But I'm still coming up to speed with dbplyr, so I'll have a better idea in a few days. |
Yeah, it's a bit scary. The commits are self-contained, how about splitting them into individual pull requests? |
ORDER BY
clauses in subqueries are problematic:As a stop gap, we could remove
ORDER BY
clauses from inner queries if we don't combine the inner and the outer query. With a warning. This would also solve #275. I wonder if this generates spurious warnings, e.g., for window functions.Alternatively, we could allow
arrange()
only at the very last step in the pipe, and transform it towindow_order()
if additional verbs are added, with a warning. This will be a problem later when we want to support lazy operations for data frames.For a true solution, we cannot simply delay the computation due to aliasing (#94 (comment)). A few examples, and a reprex illustrating the problem (using #277), are below. This might well be out of scope.
Created on 2019-04-09 by the reprex package (v0.2.1.9000)
The text was updated successfully, but these errors were encountered: