Writes a lazy table, data frame, or SQL query to an abfs:// or
abfss:// URL using DuckDB's COPY ... TO command.
Usage
az_copy_to(
conn,
x,
url,
format = c("parquet", "csv", "json"),
partition_by = NULL,
overwrite = FALSE
)Arguments
- conn
A DuckDB connection.
- x
A lazy
dbplyrtable, data frame, SQL string, orDBI::SQLobject.- url
Character scalar. Azure Blob URL to write to.
- format
Output format. One of
"parquet","csv", or"json".- partition_by
Optional character vector of columns to partition by.
- overwrite
Logical. When
TRUE, passes DuckDB'sOVERWRITE_OR_IGNOREcopy option.
Examples
if (FALSE) { # \dontrun{
# Requires a live Azure account, credentials, and network access.
conn <- az_conn()
az_copy_to(
conn,
"SELECT * FROM events WHERE event_date >= DATE '2026-01-01'",
"abfss://container@account/exports/events",
format = "parquet"
)
} # }