Skip to content
DuckDB community extension

warc

Parse WARC (Web ARChive) records for Common Crawl data processing

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 Β· SQL
INSTALL warc FROM community;
LOAD warc FROM community;

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

Parse a WARC record from a gzip-compressed file

SQL session and output
-- Parse a WARC record from a gzip-compressed file
SELECT parse_warc(content) FROM read_blob('record.warc.gz');
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              parse_warc(content)                            β”‚
β”‚ struct(warc_version varchar, warc_headers varchar, http_version varchar,    β”‚
β”‚        http_status integer, http_headers varchar, http_body blob)           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ {'warc_version': '1.0', 'warc_headers': '{"WARC-Type": "response", ...}',   β”‚
β”‚  'http_version': 'HTTP/1.1', 'http_status': 200,                            β”‚
β”‚  'http_headers': '{"content-type": "text/html", ...}',                      β”‚
β”‚  'http_body': <!doctype html>...}                                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

-- Extract specific fields
SELECT
    (parse_warc(content)).http_status,
    (parse_warc(content)).http_body
FROM read_blob('record.warc.gz');

Provided by midwork-finds-jobs. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

The WARC extension parses WARC (Web ARChive) records, the standard format used by Common Crawl and web archiving tools. It enables efficient processing of web archive data directly in DuckDB.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
midwork-finds-jobs/duckdb_warc
License
MIT
Maintainers
onnimonni
Written in
Rust
Build source
954cbe42e5fd
Build definition
Community descriptor