documentation/query/functions/parquet.md
QuestDB can read and query external Apache Parquet files using SQL.
To export data as Parquet, see Parquet Export.
:::info Apache Parquet support is in beta. Please report issues via email, Slack, or Discourse. :::
Reads a parquet file as a table.
read_parquet(parquet_file_path)
The file path must be within the configured root directory. It can be specified as a relative path (resolved under the root) or as an absolute path (which must still start with the root directory). Path traversal (../) is not allowed.
SELECT * FROM read_parquet('trades.parquet')
WHERE side = 'buy'
LIMIT 1;
| symbol | side | price | amount | timestamp |
|---|---|---|---|---|
| BTC-USD | buy | 62755.6 | 0.00043367 | 2024-07-01T00:46:39.754075Z |
SELECT * FROM read_parquet('/var/lib/questdb/import/trades.parquet');
SELECT t.symbol, t.price, r.label
FROM read_parquet('trades.parquet') t
JOIN ref_data r ON t.symbol = r.symbol;
For security reasons, reading is only allowed from a configured directory. By default, this is the import directory
inside the QuestDB root directory (e.g. /var/lib/questdb/import/). To change it, set cairo.sql.copy.root:
server.conf: cairo.sql.copy.root=/path/to/dirQDB_CAIRO_SQL_COPY_ROOTParquet format supports a rich set of data types, including structural types. QuestDB can only read Parquet columns whose types map to QuestDB types:
Parquet columns with unsupported data types are ignored.
Only a single file can be read per read_parquet call.