Skip to contents

Returns a lazy reference to a table in the attached DuckLake. Like dplyr::tbl(), nothing is read until you collect(): build up your filter()/mutate()/summarise() pipeline first and DuckDB executes it as a single query, only pulling the rows you asked for into R.

Usage

get_ducklake_table(tbl_name)

Arguments

tbl_name

Character string, name of the table to retrieve.

Value

A lazy table (class tbl_ducklake) that works with dplyr verbs. The table name is stored in the ducklake_table_name attribute.

Examples

if (FALSE) { # \dontrun{
attach_ducklake("my_lake", lake_path = "~/data/lake")
create_table(mtcars, "cars")

# Query lazily with dplyr, then collect
get_ducklake_table("cars") |>
  dplyr::filter(cyl > 4) |>
  dplyr::summarise(avg_mpg = mean(mpg), .by = cyl) |>
  dplyr::collect()
} # }