Skip to contents

Validates the URL, loads the azure and delta extensions, then returns a lazy dplyr::tbl() over the table. Use az_conn() first if the connection needs Azure extensions, settings, or secrets.

Usage

tbl_delta(
  conn,
  url,
  name = NULL,
  method = c("attach", "view"),
  replace = TRUE,
  version = NULL,
  timestamp = NULL
)

Arguments

conn

A DuckDB connection.

url

Character scalar. Azure Blob URL pointing to a Delta table (e.g. "abfss://container@account.dfs.core.windows.net/path/table").

name

Optional character scalar. Name to register the table under in DuckDB. When NULL (default) the table is scanned directly.

method

"attach" (default) or "view". Ignored when name = NULL.

replace

Logical. Replace an existing registration of the same name. Default TRUE. Ignored when name = NULL.

version

Optional non-negative Delta table version to read.

timestamp

Deprecated. Not supported: DuckDB's delta extension accepts a TIMESTAMP attach option but ignores it, returning the latest snapshot. Supplying it raises an error. Use version instead.

Value

A dplyr::tbl() backed by the Delta table.

Details

When name is NULL the table is queried directly via delta_scan() with no persistent object registered on the connection. When name is supplied the table is first registered via load_delta() (as an ATTACH database or a VIEW depending on method), then referenced by name.

Delta time travel currently requires name because DuckDB exposes version through ATTACH, not delta_scan().

Examples

if (FALSE) { # \dontrun{
# Requires a live Azure account, credentials, and network access.
conn <- az_conn()
tbl_delta(conn, "abfss://container@account/path/sales") |>
  dplyr::filter(amount > 100) |>
  dplyr::collect()
} # }