Skip to content
DuckDB community extension

orc

A DuckDB extension for reading Apache ORC files, written in pure Rust. Supports all ORC primitives, struct, list, map types and all compression codecs (Zlib, Snappy, LZO, LZ4, ZSTD).

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 orc FROM community;
LOAD orc FROM community;

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

02 / QUERY

Usage example

Read a single ORC file

SQL
-- Install and use the ORC extension

-- Read a single ORC file
SELECT * FROM read_orc('data.orc');

-- Read multiple ORC files with a glob pattern
SELECT * FROM read_orc('sales/*.orc');

-- Filter and aggregate (DuckDB applies filters post-scan)
SELECT region, SUM(amount)
FROM read_orc('sales.orc')
WHERE year = 2024
GROUP BY region;

-- Column projection is pushed down to the ORC reader
SELECT col1, col2 FROM read_orc('big_table.orc');

Provided by alitrack. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

Built on top of orc-rust, a native Rust ORC reader that outputs Arrow record batches.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
alitrack/duckdb_orc
License
MIT
Maintainers
alitrack
Written in
Rust
Build source
e2bb83eb1f50
Build definition
Community descriptor