You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue when slice_* calls are translated to SQL when the order_by parameter uses .data$ notation rather than a bare symbol name. The generated SQL erroneously prefixes .data to the order by clause, which causes the query to fail.
# Expected behaviour (using local df)mtcars %>%
group_by(.data$cyl) %>%
slice_max(.data$mpg)
# Returns 1 row per group, ordered by MPG# Observed behaviour (fails)rem_mtcars<- copy_to(connection, mtcars)
rem_mtcars %>%
group_by(.data$cyl) %>%
slice_max(.data$mpg)
# This worksrem_mtcars %>%
group_by(.data$cyl) %>%
slice_max(mpg)
An example of the generated SQL is
ROW_NUMBER() OVER (PARTITION BY "cyl" ORDER BY ".data"."mpg" DESC)
The translation works fine when using arrange, it is only for the window functions I have observed the issue.
I've tested this with Redshift and SQLite with the same output.
The text was updated successfully, but these errors were encountered:
There is an issue when
slice_*
calls are translated to SQL when theorder_by
parameter uses.data$
notation rather than a bare symbol name. The generated SQL erroneously prefixes .data to the order by clause, which causes the query to fail.An example of the generated SQL is
ROW_NUMBER() OVER (PARTITION BY "cyl" ORDER BY ".data"."mpg" DESC)
The translation works fine when using
arrange
, it is only for the window functions I have observed the issue.I've tested this with Redshift and SQLite with the same output.
The text was updated successfully, but these errors were encountered: