lubridate / dbplyr interface

460 views
Skip to first unread message

NaN

unread,
Jun 5, 2017, 10:18:13 AM6/5/17
to manipulatr
I really like the dbplyr package and the ability to use a powerful database-backend directly in R. However, some functions like date-aggregations are not available in dplyr (or I was not able to find them) - For weekly aggregations for example you have to use cut.Date or another library (e.g., lubridate). Or is it possible to use the lubridate interface and translate the aggregation directly into SQL? I know that especially the date time functions in databases are really different, but it would be nice, if this stuff can be outsourced.

Hadley Wickham

unread,
Jun 16, 2017, 9:43:19 AM6/16/17
to NaN, manipulatr
I think that's something we might explore in the future, but it's
quite a bit of work to do across all the database backends.

Hadley
> --
> You received this message because you are subscribed to the Google Groups
> "manipulatr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to manipulatr+...@googlegroups.com.
> To post to this group, send email to manip...@googlegroups.com.
> Visit this group at https://groups.google.com/group/manipulatr.
> For more options, visit https://groups.google.com/d/optout.



--
http://hadley.nz

Christian Hotz-Behofsits

unread,
Jun 17, 2017, 2:20:15 AM6/17/17
to Hadley Wickham, manipulatr
You are right, sounds like a lot of work. But we would like to implement something for our clickhouse dplyr backend and we are looking for nice interfaces. Any suggestions?

Hadley Wickham

unread,
Jun 17, 2017, 10:24:25 AM6/17/17
to Christian Hotz-Behofsits, manipulatr
Read http://dbplyr.tidyverse.org/articles/sql-translation.html and
then the very end of
http://dbplyr.tidyverse.org/articles/new-backend.html#sql-translation.
It's quite a bit of work, but shouldn't be too complicated. Most of
the work is sitting down and planning exactly what you want to
translate, and the basic shape of the translation. If you were going
to work on this, I'd be happy to provide some review so that I could
then role it out to other backends.

Hadley
--
http://hadley.nz
Reply all
Reply to author
Forward
0 new messages