Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
`dplyr::arrange()` with the `.by_group=TRUE` parameter set produces SQL with an error #115
@CerebralMastication commented on Apr 15, 2018, 1:56 PM UTC:
This is a cross post from the RStats Community, where I initially posted it: https://community.rstudio.com/t/dplyr-arrange-by-group-true-fails-with-sql-backend/7232
I've either got a misunderstanding or a bug... I think it's a bug.
It seems that
On the DB (Redshift in my case) set up a dummy table:
which generates the following SQL:
which fails if I try to
the rub seems to be the
My guess is that the routine that generates the SQL has a glitch. Looks like it's just passing
@hadley commented on May 20, 2018, 1:43 PM UTC:
library(dplyr, warn.conflicts = FALSE) lf <- dbplyr::lazy_frame(x = 1, y = 1, src = dbplyr::simulate_dbi()) lf %>% group_by(x) %>% arrange(y, .by_group = TRUE) %>% show_query() #> <SQL> SELECT * #> FROM "df" #> ORDER BY "y", TRUE
Created on 2018-05-20 by the reprex package (v0.2.0).