Query Apache Paimon tables directly from DuckDB
Installing and Loading
INSTALL paimon FROM community;
LOAD paimon;
Example
INSTALL paimon FROM community;
LOAD paimon;
-- Query a local Paimon warehouse as a catalog
ATTACH './data' AS local_paimon (TYPE paimon);
SELECT count(*) FROM local_paimon.testdb.testtbl;
-- Or scan one table without attaching the warehouse
SELECT * FROM paimon_scan('./data/testdb.db/testtbl');
-- Configure credentials for remote object storage
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 and query a remote Paimon warehouse
ATTACH 'oss://your-bucket/warehouse' AS oss_paimon (TYPE paimon);
SELECT count(*) FROM oss_paimon.your_db.your_table;
-- Inspect the snapshots available for a Paimon table
SELECT snapshot_id, commit_time
FROM paimon_snapshots('./data/testdb.db/testtbl');
-- Query a specific snapshot
SELECT * FROM paimon_scan('./data/testdb.db/testtbl', snapshot_from_id=2);
About paimon
The Paimon extension lets DuckDB read and query Apache Paimon tables directly. Apache Paimon is a lake format for realtime lakehouse workloads with Flink and Spark.
Capabilities:
- Read Paimon tables from local filesystems and remote object storage.
- Create append-only tables and insert data, plus create and drop schemas and tables through an attached catalog.
- Attach filesystem or REST catalogs, or scan a single table with
paimon_scan. - Inspect snapshot history and query a historical snapshot by ID or timestamp.
- Push projections and predicates down to reduce the data read.
- Zero JVM dependency — Pure C++ implementation
- Apache Arrow data exchange for zero-copy transfers and parallel scans across DuckDB threads.
- Use scoped DuckDB Secrets for Alibaba Cloud OSS or Amazon S3 credentials.
Remote filesystem warehouses support Alibaba Cloud OSS and Amazon S3. Configure S3 with DuckDB's credential chain or static credentials; remote object storage catalogs are currently read-only. Paimon REST catalogs can be attached with METASTORE 'rest', the catalog server URI, and an access token.
Built on paimon-cpp, the extension brings DuckDB's local analytics to the Paimon data lake ecosystem.
For more information, visit the extension repository.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| paimon_scan | table | NULL | NULL | |
| paimon_snapshots | table | NULL | NULL |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
This extension does not add any settings.