COPY TO writes query results to an external file, making it useful for exporting transformed data in command-line pipelines. CSV output can be redirected, while Parquet output uses COPY with an explicit destination and format. section 2.5.1 section 5.4
Export Western European indicators to Parquet
duckdb -s "COPY ( SELECT Country, Population, Birthrate, Deathrate FROM read_csv_auto('https://bit.ly/3KoiZR0') WHERE trim(region) = 'WESTERN EUROPE' ) TO 'western_europe.parquet' (FORMAT PARQUET)". The resulting file can be read with DuckDB or another Parquet reader.
