Extension for querying Px-files with DuckDB.
Maintainer(s):
toppyy
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 px FROM community;
LOAD px;
Example
FROM read_px('your_dataset.px');
About px
This extension provides the ability to query Px-files with DuckDB.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| read_px | table | Reads a PX (PC-Axis) file and returns its contents as a table with STUB/HEADING variables as VARCHAR columns and a 'value' column (INTEGER if DECIMALS=0, otherwise FLOAT). | NULL | [SELECT * FROM read_px('test/data/statfin_vaerak_pxt_11rc.px');] |
| read_px_metadata | table | Reads metadata from a PX (PC-Axis) file and returns the available CODE-VALUE pairs per variable without scanning the DATA section. Returns columns: 'variable' (VARCHAR), 'code' (VARCHAR), 'value' (VARCHAR, NULL if no VALUES entry exists). | NULL | [SELECT * FROM read_px_metadata('test/data/statfin_vaerak_pxt_11rc.px');, SELECT * FROM read_px_metadata('test/data/statfin_vaerak_pxt_11rc.px') WHERE variable='Sukupuoli';] |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases | typed_value |
|---|---|---|---|---|---|
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |