Livestream: Ducklake & The Future of Open Table Formats - June 17Register Now

Skip to main content

Writing Data to Amazon S3

You can use MotherDuck to transform files on Amazon S3 or export data from MotherDuck to Amazon S3.

note

MotherDuck supports several cloud storage providers, including Azure, Google Cloud and Cloudflare R2.

MotherDuck supports the DuckDB dialect to write data to Amazon S3. The examples here write data in Parquet format, for more options refer to the documentation for DuckDB's COPY command.

Syntax

COPY <table name> TO 's3://<bucket>/[<path>]/<file name>';

Example usage

-- write entire ducks_table table to parquet file in S3
COPY ducks_table to 's3://ducks_bucket/ducks.parquet';

-- writing the output of a query will also work
COPY (SELECT * FROM ducks_table LIMIT 100) to 's3://ducks_bucket/ducks_head.parquet';