Skip to contents

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

Usage

tbl_csv(conn, url, name = NULL, replace = TRUE, ...)

Arguments

conn

A DuckDB connection.

url

Character scalar. Azure Blob URL. Supports glob patterns.

name

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

replace

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

...

Reader options forwarded to DuckDB's read_csv_auto().

Value

A dplyr::tbl() backed by the CSV dataset.

Details

When name is NULL the dataset is queried directly via read_csv_auto() with no persistent object registered on the connection. When name is supplied the dataset is first registered as a VIEW via load_csv(), then referenced by name.

Examples

if (FALSE) { # \dontrun{
# Requires a live Azure account, credentials, and network access.
conn <- az_conn()
tbl_csv(conn, "abfss://container@account/data/*.csv") |>
  dplyr::collect()
} # }