Skip to contents

The in-memory DuckDB connection that parquet_tbl(), parquet_metadata() and data_to_parquet() use. It gets created on first use and is cached for the session, so that tables from different parquet_tbl() calls can be joined with each other.

Usage

parquet_connection()

Value

a DuckDB connection.

Details

Use it to bring other data onto the same connection, e.g. dplyr::copy_to(parquet_connection(), df) to join a data frame with a parquet table, or to change DuckDB settings via DBI::dbExecute(), like SET memory_limit = '4GB' or SET threads = 2. Disconnecting it, e.g. to free memory, is fine, the next call creates a new connection, but tables created on the old connection stop working. parquet_tbl() can also create its tables on a connection of your own via its con argument.

The connection is DuckDB's connection class extended with the package's SQL translation, which renders whole numbers in comparisons as integers, see parquet_tbl(); everything else works as on any DuckDB connection.