Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add example of workaround for large data + fallback #602

Open
maelle opened this issue Feb 11, 2025 · 2 comments
Open

add example of workaround for large data + fallback #602

maelle opened this issue Feb 11, 2025 · 2 comments
Assignees

Comments

@maelle
Copy link
Collaborator

maelle commented Feb 11, 2025

  • put data into a table with compute()
  • run an SQL query
@krlmlr
Copy link
Member

krlmlr commented Feb 11, 2025

options(conflicts.policy = list(warn = FALSE))
library(duckplyr)
#> Loading required package: dplyr
#> ✔ Overwriting dplyr methods with duckplyr methods.
#> ℹ Turn off with `duckplyr::methods_restore()`.

data <-
  duckdb_tibble(a = 2) |>
  mutate(b = 3)

computed_data <-
  data |>
  compute(name = "computed_data")

sql_data <-
  read_sql_duckdb("SELECT *, a * b AS c FROM computed_data")

sql_data
#> # A duckplyr data frame: 3 variables
#>       a     b     c
#>   <dbl> <dbl> <dbl>
#> 1     2     3     6

Created on 2025-02-11 with reprex v2.1.1

@maelle
Copy link
Collaborator Author

maelle commented Feb 11, 2025

to be added to large.Rmd

@maelle maelle assigned maelle and unassigned krlmlr Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants