-
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
Several related issues with fill()
#1057
Comments
Thanks for opening the issue. I'm not quite sure about the row ordering though.
I think in general the database can order the rows however it wants. So, it's not guaranteed to be sorted.
The same as above. I don't think the order is guaranteed unless you explicitly arrange the data.
|
Fair point about the row ordering, the function name is a bit unfortunate though if we don't reorder, since filling "up" does fill "down" visually. Another issue, that I can't reproduce with SQLite since it does not have date columns, but that I see with Oracle.
Strangely this does work for .direction = "down" |
Unfortunately, this cannot really be avoided unless we add an extra SELECT `id`, MAX(`val`) OVER (PARTITION BY `..dbplyr_partion_1`) AS `val`
FROM (
SELECT
*,
SUM(CASE WHEN ((`val` IS NULL)) THEN 0 ELSE 1 END) OVER (ORDER BY `id` DESC ROWS UNBOUNDED PRECEDING) AS `..dbplyr_partion_1`
FROM `mydata`
) the order is chosen by the database. SQLite orders it "the wrong way" (visually), other databases might order it completely random. This is just the way a database works. But in my PR I fixed:
You can install it via |
fill()
doesn't work as expected, see reprex.Created on 2022-11-30 with reprex v2.0.2
I think we need :
arrange()
, something like :.direction = "up"
The text was updated successfully, but these errors were encountered: