- Notifications
You must be signed in to change notification settings - Fork47
feat: add two utility functions export_parquet and create_view and a vignette on how to materialize data.#1177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…vignette* export_parquet uses COPY TO to export a parquet file from a tbl_lazy* create_view creates a view based on a tbl_lazyThe vignette explains how to materialize data with those two functions and dbplyr::compute()Fixesduckdb#207,duckdb#630
krlmlr commentedJun 17, 2025
Thanks for the effort. The code looks good, I'm still not ready to assume maintenance for it. I labeled the issues as "help wanted" before duckplyr 1.1.0. Writing to Parquet works there: library(tidyverse)library(duckdb)#> Loading required package: DBIcon<- dbConnect(duckdb::duckdb())dbWriteTable(con,"my_tbl",data.frame(a=1))dbplyr_tbl<- tbl(con,"my_tbl")dbplyr_tbl %>%duckplyr::as_duckdb_tibble()|>duckplyr::compute_parquet("my_tbl.parquet")#> # A duckplyr data frame: 1 variable#> a#> <dbl>#> 1 1duckplyr_parquet<-duckplyr::read_parquet_duckdb("my_tbl.parquet")duckplyr_parquet#> # A duckplyr data frame: 1 variable#> a#> <dbl>#> 1 1 Created on 2025-06-17 withreprex v2.1.1 As for creating a view, dbplyr or a related package is a better fit, this functionality seems general enough to work across databases. I'd like to keep the package vignette-free for shorter build times. Otherwise, each Happy to see this code thrive elsewhere! |
This PR add two utility functions :
The vignette explains how to materialize data using these two functions, as well as with the lesser-known dbplyr::compute() function.
Fixes#207,#630