Parquet functions
This page introduces the Apache Parquet read function.
Apache Parquet support is in beta.
It may not be fit for production use.
Please let us know if you run into issues.
Either:
- Email us at support@questdb.io
- Join our public Slack
- Post on our Discourse community
read_parquet
Reads a parquet file as a table.
read_parquet(parquet_file_path)
Usage
With this function, query a Parquet file located at the QuestDB copy root directory. Both relative and absolute file paths are supported.
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 |
The query above:
- Reads all columns from the file
trades.parquet
located at the server copy root directory, i.e.import/trades.parquet
in the QuestDB copy root directory by default. - Filters rows, keeping only the first row where the
side
column equalsbuy
.
Configuration
For security reason, reading is only allowed from a specified directory. It defaults to the import
directory
inside the QuestDB copy root directory. To change the allowed directory, set the cairo.sql.copy.root
configuration by using one of the following settings:
- The environment variable
QDB_CAIRO_SQL_COPY_ROOT
. - The
cairo.sql.copy.root
key inserver.conf
.
Limitations
Parquet format support rich set of data types, including structural types. QuestDB only can read data types that match QuestDB data types:
- Varchar
- Int
- Long
- Short
- Byte
- Boolean
- UUID
- Double
- Float
- Timestamp
- Binary
Parquet columns with unsupported data types are ignored.
Multiple files are not suppored, only a single file.
Nested data and/or arrays are not supported.