Query and write Apache TsFile table-model files from DuckDB
Compatibility Matrix
This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
|---|---|---|---|---|---|
| Linux AMD64 | |||||
| Linux ARM64 | |||||
| macOS AMD64 | |||||
| macOS ARM64 | |||||
| Windows AMD64 | |||||
| Windows ARM64 | |||||
| WebAssembly |
Installing and Loading
INSTALL tsfile FROM community;
LOAD tsfile;
Example
INSTALL tsfile FROM community;
LOAD tsfile;
SELECT time, device_id, temperature
FROM read_tsfile('/data/measurements.tsfile', 'sensors')
WHERE time BETWEEN 1700000000000 AND 1700003600000;
About tsfile
The TsFile extension exposes the read_tsfile(path, table_name) table function for querying Apache TsFile table-model files and supports writing query results with COPY … TO … (FORMAT TSFILE). It maps TsFile columns to DuckDB types, pushes projections, time predicates, and TAG predicates into the reader, and streams results in DuckDB vector-sized batches.
The initial release supports one local file and one table per scan. Tree-model files, multi-file scans, automatic table discovery, parallel scans, and FIELD predicate pushdown are not yet implemented.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| read_tsfile | 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.