This extension enables DuckDB to read and query Apache Paimon format data directly — no ETL pipelines, no Flink/Spark clusters required. Just open a DuckDB shell and run SQL against your Paimon tables.
Similar to other extensions, duckdb-paimon brings DuckDB's powerful local analytics to the Paimon data lake ecosystem.
The following DuckDB release lines and platforms are supported. We recommend installing from the DuckDB community repository, following the Install and Load instructions. Prebuilt bundles are also available from GitHub Releases.
| DuckDB | Branch | Linux x86_64 (glibc) | Linux ARM64 (glibc) | macOS ARM64 (Apple Silicon) |
|---|---|---|---|---|
| 2.0 | main |
✅ | ✅ | ✅ |
| 1.5 | v1.5-variegata |
✅ | ✅ | ✅ |
| 1.4 | v1.4-andium |
✅ | ✅ | ✅ |
Windows, Intel macOS, musl-based Linux (including Alpine), and WebAssembly builds are not currently provided.
Extension binaries must match the exact DuckDB version and platform. See the community extension page for available community builds, or check the GitHub release asset names when downloading bundles.
Apache Paimon is a lake format that enables building a Realtime Lakehouse Architecture with Flink and Spark for both streaming and batch operations. It innovatively combines lake format and LSM structure, bringing realtime streaming updates into the lake architecture.
This extension is built on top of paimon-cpp, an open-source C++ library that provides native access to Paimon format data. It is the first library that brings native Paimon read/write capabilities to the C++ ecosystem.
- Zero JVM dependency — No Java runtime required. Pure C++ implementation means minimal memory footprint and instant startup.
- Apache Arrow data exchange — Data flows between paimon-cpp and DuckDB via Apache Arrow, the industry standard for columnar in-memory data, enabling zero-copy transfers with no serialization overhead.
- Parallel scan architecture — Paimon tables are split into independent Splits, and DuckDB's multi-threaded execution engine reads them in parallel to fully utilize multi-core CPUs.
- Secure credential management — Object storage credentials are managed through DuckDB's native Secret Manager with scope isolation and automatic key redaction.
- Read Paimon table data from local filesystems and remote object storage
- Write Paimon tables (CREATE TABLE AS, INSERT INTO; append-only tables only)
- DDL support (CREATE/DROP SCHEMA, CREATE/DROP TABLE)
- Projection pushdown optimization
- Predicate pushdown optimization
- Multiple file format support (manifest / data)
- Filesystem and REST catalog ATTACH support
- DuckDB Secret-based object storage credential management
- Snapshot history inspection
- Snapshot-based time travel queries
Data is written into Paimon by Flink in real time. Analysts can query it directly on OSS using DuckDB + duckdb-paimon — no compute cluster needed, reducing query latency from minutes to seconds.
Use DuckDB in CI/CD pipelines to run data quality assertions on Paimon tables, verifying that Flink job outputs meet expectations. Lightweight, fast, and dependency-free.
Data engineers developing Flink jobs can instantly inspect the current state of Paimon tables using DuckDB Shell, quickly locating data issues — far more efficient than launching a Flink SQL Client.
DuckDB natively supports Parquet, CSV, JSON, Iceberg, and more. Combined with duckdb-paimon, you can JOIN Paimon tables with other data sources without any data movement:
-- Join a Paimon orders table with a local CSV dimension table
SELECT o.order_id, o.amount, c.customer_name
FROM paimon_scan('oss://...', 'db', 'orders') o
JOIN read_csv('customers.csv') c ON o.customer_id = c.id;Install and load the extension from DuckDB's community repository:
INSTALL paimon FROM community;
LOAD paimon;The examples in this section use sample data bundled in the data/ directory of this repository.
Attach a Paimon warehouse as a catalog, then query its tables using standard DuckDB SQL. Use paimon_scan instead when attaching a whole warehouse is unnecessary. The local path below is only an example:
-- Attach a warehouse and query its tables.
ATTACH './data' AS local_paimon (TYPE paimon);
SELECT count(*) FROM local_paimon.testdb.testtbl;
-- Alternatively, scan a single table with paimon_scan.
SELECT count(*) FROM paimon_scan('./data/testdb.db/testtbl');
SELECT count(*) FROM paimon_scan('./data', 'testdb', 'testtbl');With an ATTACHed catalog, you can create schemas, create tables, and insert data using standard DuckDB SQL:
ATTACH './data' AS my_catalog (TYPE paimon);
CREATE SCHEMA my_catalog.my_db;
CREATE TABLE my_catalog.my_db.orders AS
SELECT 1 AS order_id, 99.9::DECIMAL(18,2) AS amount, 'Alice' AS customer;
INSERT INTO my_catalog.my_db.orders
SELECT 2, 49.5, 'Bob'
UNION ALL
SELECT 3, 150.0, 'Charlie';
SELECT * FROM my_catalog.my_db.orders ORDER BY order_id;
DROP TABLE my_catalog.my_db.orders;
DROP SCHEMA my_catalog.my_db;To prevent accidental writes, attach the catalog in read-only mode:
ATTACH './data' AS my_catalog (TYPE paimon, READ_ONLY);Use paimon_snapshots to list all snapshots of a Paimon table — useful for auditing commit history, diagnosing data issues, or identifying a snapshot ID for time-travel queries:
SELECT snapshot_id, commit_kind, commit_time, total_record_count
FROM paimon_snapshots('./data/testdb.db/testtbl')
ORDER BY snapshot_id;
┌─────────────┬─────────────┬─────────────────────────┬────────────────────┐
│ snapshot_id │ commit_kind │ commit_time │ total_record_count │
│ int64 │ varchar │ timestamp │ int64 │
├─────────────┼─────────────┼─────────────────────────┼────────────────────┤
│ 1 │ APPEND │ 2026-01-15 10:48:23.486 │ 3 │
│ 2 │ APPEND │ 2026-01-15 10:48:23.509 │ 6 │
│ 3 │ APPEND │ 2026-01-15 10:48:23.528 │ 9 │
└─────────────┴─────────────┴─────────────────────────┴────────────────────┘Query a historical version of a table by snapshot ID or by timestamp. Use paimon_snapshots first to identify the snapshot you want.
When using an ATTACHed catalog, use DuckDB's native AT clause. For a single table scan, pass the same snapshot option to paimon_scan:
-- Query an attached catalog with DuckDB's native AT clause.
ATTACH './data' AS my_catalog (TYPE paimon);
-- AT (VERSION => snapshot_id)
SELECT count(*) FROM my_catalog.testdb.testtbl AT (VERSION => 2);
-- AT (TIMESTAMP => point_in_time)
SELECT count(*) FROM my_catalog.testdb.testtbl AT (TIMESTAMP => TIMESTAMP '2026-01-15 10:48:23.5');
-- Alternatively, scan a single table with paimon_scan.
-- Read from a specific snapshot (6 rows — state after the second append)
SELECT count(*) FROM paimon_scan('./data/testdb.db/testtbl', snapshot_from_id=2);
-- Read from a point in time (returns the snapshot active at that moment)
SELECT count(*) FROM paimon_scan('./data/testdb.db/testtbl', snapshot_from_timestamp=TIMESTAMP '2026-01-15 10:48:23.5');Tables in remote object storage can be queried directly through a filesystem catalog or through a REST catalog.
Create a scoped Paimon Secret before attaching or scanning a remote table. Remote object storage catalogs are read-only (currently).
CREATE SECRET my_oss (
TYPE paimon,
PROVIDER config,
key_id 'your-access-key-id',
secret 'your-access-key-secret',
endpoint 'oss-cn-hangzhou.aliyuncs.com',
scope 'oss://your-bucket/warehouse'
);
ATTACH 'oss://your-bucket/warehouse' AS oss_paimon (TYPE paimon);
SELECT count(*) FROM oss_paimon.your_db.your_table;
SELECT count(*) FROM paimon_scan('oss://your-bucket/warehouse/your_db.db/your_table');Choose one S3 credential provider for a scope. credential_chain uses the AWS credential chain, including the selected AWS CLI profile and refreshed SSO credentials when available:
CREATE SECRET my_s3 (
TYPE paimon,
PROVIDER credential_chain,
profile 'default',
region 'ap-northeast-2',
scope 's3://your-bucket/warehouse'
);Use config to provide static credentials instead:
CREATE SECRET my_s3_static (
TYPE paimon,
PROVIDER config,
key_id 'your-access-key-id',
secret 'your-secret-access-key',
session_token 'optional-session-token',
region 'ap-northeast-2',
scope 's3://your-bucket/warehouse'
);After creating either Secret, attach or scan the warehouse:
ATTACH 's3://your-bucket/warehouse' AS s3_paimon (TYPE paimon);
SELECT count(*) FROM s3_paimon.your_db.your_table;
SELECT count(*) FROM paimon_scan('s3://your-bucket/warehouse/your_db.db/your_table');COS exposes an S3-compatible API, so connect to it through the s3:// scheme and a COS endpoint. key_id is the Tencent Cloud SecretId, secret is the SecretKey, region is the COS region, and the bucket name keeps its APPID suffix:
CREATE SECRET my_cos (
TYPE paimon,
PROVIDER config,
key_id 'your-secret-id',
secret 'your-secret-key',
region 'ap-guangzhou',
endpoint 'https://cos.ap-guangzhou.myqcloud.com',
path_style_access false,
scope 's3://your-bucket-1250000000/warehouse'
);
ATTACH 's3://your-bucket-1250000000/warehouse' AS cos_paimon (TYPE paimon);
SELECT count(*) FROM cos_paimon.your_db.your_table;
SELECT count(*) FROM paimon_scan('s3://your-bucket-1250000000/warehouse/your_db.db/your_table');The endpoint must carry the https:// scheme. path_style_access false selects virtual-hosted-style addressing (your-bucket-1250000000.cos.ap-guangzhou.myqcloud.com), which COS requires for buckets created after January 1, 2024; the bundled patches/paimon-cpp-s3-virtual-host-addressing.patch makes virtual-hosted addressing the default for HTTPS endpoints. Bucket names containing dots are the exception: over HTTPS they keep path-style addressing, because a *.<endpoint-host> certificate does not cover a multi-label subdomain such as name.with.dots.<endpoint-host>. path_style_access true still forces path-style everywhere, and plain http:// or IP-address endpoints are unaffected by this change. Tencent Cloud STS temporary keys take an additional session_token '...'.
Use a REST catalog when Paimon catalog metadata is served through the Paimon REST Catalog API. The first ATTACH argument (my_warehouse) is sent to the REST server as its warehouse identifier; set it to the warehouse or instance your server expects. rest_paimon is only the local DuckDB catalog name.
ATTACH 'my_warehouse' AS rest_paimon (
TYPE paimon,
METASTORE 'rest',
URI 'http://catalog.example:8080',
TOKEN_PROVIDER 'bear',
TOKEN 'your-access-token'
);
SELECT count(*) FROM rest_paimon.your_db.your_table;Clone the repository with submodules:
git clone --recurse-submodules https://github.com/polardb/duckdb-paimon.git
cd duckdb-paimon--recurse-submodules pulls DuckDB and paimon-cpp, which are required to build the extension.
Build in release mode:
GEN=ninja makeOr build in debug mode:
GEN=ninja make debugAfter building, launch the matching DuckDB shell with the extension pre-loaded:
# Release
./build/release/duckdb
# Debug
./build/debug/duckdb# Release
make test
# Debug
make test_debugSee the contributing guide for how to report issues and submit pull requests.
- Apache Paimon — Realtime lakehouse format
- paimon-cpp — Native C++ library for Paimon (underlying dependency)
- DuckDB — Embeddable OLAP database
We welcome contributions and discussions! If you have questions, ideas, or want to connect with other users and developers, join our community by clicking here or scan the QR code below:
