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
However, if we simply remove the dplyr:: namespace, it works fine:
>dbplyr::lazy_frame(a=5:1, b=1:5) |>dplyr::mutate(dplyr::across(dplyr::everything(), dense_rank)) |>dplyr::show_query()
<SQL>SELECTCASE
WHEN (NOT((`a`ISNULL))) THEN DENSE_RANK() OVER (PARTITION BY (CASE WHEN ((`a`ISNULL)) THEN1ELSE0END) ORDERBY`a`)
ENDAS`a`,
CASE
WHEN (NOT((`b`ISNULL))) THEN DENSE_RANK() OVER (PARTITION BY (CASE WHEN ((`b`ISNULL)) THEN1ELSE0END) ORDERBY`b`)
ENDAS`b`FROM`df`
Also, if we don't use across():
>dbplyr::lazy_frame(a=5:1, b=1:5) |>dplyr::mutate(a=dplyr::dense_rank(a)) |>dplyr::show_query()
<SQL>SELECTCASE
WHEN (NOT((`a`ISNULL))) THEN DENSE_RANK() OVER (PARTITION BY (CASE WHEN ((`a`ISNULL)) THEN1ELSE0END) ORDERBY`a`)
ENDAS`a`,
`b`FROM`df`
The text was updated successfully, but these errors were encountered:
Here is a strange edge case. Under the following conditions,
dplyr::dense_rank
is not converted to aDENSE_RANK()
SQL function:dplyr::dense_rank()
is inside adplyr::across()
dplyr
is not attached vialibrary
dplyr::dense_rank
Here are some examples. Firstly, the failure case. Note how
vec_rank
(which is adplyr
, and not an SQL function) is used:However, if we simply remove the
dplyr::
namespace, it works fine:Also, if we don't use
across()
:The text was updated successfully, but these errors were encountered: