KevsRobots Learning Platform
63% Percent Complete
By Kevin McAleer, 2 Minutes
DuckDB can read remote files over HTTPS and S3 without running a server.
Seeing new terms (predicate pushdown, partition pruning, manifest)? See the Beginner glossary.
INSTALL httpfs;
LOAD httpfs;
You try it
- Run the commands above once per database; verify with
SELECT 1;
SELECT COUNT(*)
FROM read_csv_auto('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv');
You try it
- Preview first rows with
LIMIT 5
SELECT COUNT(*)
FROM read_parquet('https://duckdb-public-datasets.s3.us-east-1.amazonaws.com/tpch/1/parquet/lineitem/part-00000-*.parquet');
You try it
- Add a filter
WHERE l_shipdate >= '1993-01-01'
If your Parquet lives in folders like β¦/year=2021/month=01/β¦, DuckDB can prune folders based on filters.
SELECT COUNT(*)
FROM read_parquet('s3://my-bucket/sales/year=*/month=*/data.parquet')
WHERE year = 2022 AND month IN (1,2,3);
You try it
- Replace
s3://my-bucket/...with your own layout (or a localsales/year=.../month=...test)- Time the query with and without the
WHEREto see fewer files scanned
CREATE OR REPLACE VIEW v_sales AS
SELECT * FROM read_parquet('s3://my-bucket/sales/year=*/month=*/data.parquet');
You try it
- Query
v_saleswith a date filter and check that itβs fast
CALL parquet_metadata('s3://my-bucket/sales/year=*/month=*/data.parquet', 'exports/sales_manifest.json');
SELECT * FROM read_parquet('exports/sales_manifest.json');
You try it
- Regenerate the manifest after adding data and observe row counts change
year, month), not computed expressions.See also: Troubleshooting DuckDB for SSL, S3, and manifest tips.
httpfs lets DuckDB read HTTPS/S3.
You can use the arrows β β on your keyboard to navigate between lessons.
Comments