For the case where a "data" column contains other data frames, nest() and unnest() for SQL tables could be made more efficient with some support by the DBI backend. For nest(), I'm thinking about a lazy operation that adds nest columns to a tbl; the actual nesting would happen in-place when fetching. The DBI backend could provide a primitive that fetches all rows until the value of one of the nest columns changes.
I think that will be out of scope for tidyr for quite some time: we currently only have one DBI backend that supported nested data structures, and bigrquery can't even fully retrieve them yet.
For the case where a "data" column contains other data frames,
nest()
andunnest()
for SQL tables could be made more efficient with some support by the DBI backend. Fornest()
, I'm thinking about a lazy operation that adds nest columns to atbl
; the actual nesting would happen in-place when fetching. The DBI backend could provide a primitive that fetches all rows until the value of one of the nest columns changes.