Database / DuckDB Interview questions
How do you query a remote Parquet file on S3 directly using DuckDB?
Querying a remote Parquet file in S3 (or any S3-compatible object storage) requires loading the httpfs extension and, typically, configuring credentials, after which the S3 path can be used directly in a query exactly as if it were a local file.
INSTALL httpfs; LOAD httpfs; SET s3_region = 'us-east-1'; SET s3_access_key_id = '...'; SET s3_secret_access_key = '...'; SELECT category, SUM(amount) FROM read_parquet('s3://my-bucket/sales/year=2026/*.parquet') GROUP BY category;
Because DuckDB uses HTTP range requests to fetch only the byte ranges actually needed, combined with Parquet's own embedded statistics for row-group pruning, a selective query against a large remote dataset can transfer only a small fraction of the total data over the network, rather than requiring the entire file (or set of files) to be downloaded locally first before any filtering happens.
More Related questions...