COPY … TO: writing a query result to object storage as files.
Recent deployment versions refuse COPY over the SQL endpoint with “COPY is not
supported”. On those, export a result by reading it through a Flight SQL client
or an SDK and writing the files from your application.
COPY (SELECT id, title FROM documents) TO 's3://bucket/export/' STORED AS PARQUET
Writes a query result to object storage. This is the export path when the
consumer is another engine rather than an application: results land as files
rather than streaming to a client.