Starburst KDB+ connector#
Note
The Starburst KDB+ connector is available as a public preview in Starburst Enterprise. Contact your Starburst account team with questions or feedback.
The KDB+ connector allows querying kdb+ time series databases from SEP using standard SQL. kdb+ is a high-performance columnar database commonly used for storing and processing large volumes of time series and financial data.
Requirements#
To use the KDB+ connector, you need:
kdb+ 4.1 or later, accessible from the SEP coordinator and all workers.
Network access from the SEP coordinator and workers to the kdb+ host and port (default:
5000).If kdb+ is configured with access control, valid credentials with at least read access.
Note
The connector has been tested against kdb+ 4.1. Earlier versions might work but are not officially supported.
Note
The KDB+ connector is read-only. Write operations are not supported.
Configuration#
To configure the KDB+ connector, create a catalog properties file that
specifies the connector by setting the connector.name to
starburst_kdb.
connector.name=starburst_kdb
kdb.host=kdb-host.example.com
kdb.port=5000
If authentication is required, configure these additional properties:
kdb.user=myuser
kdb.password=secret
Configuration properties#
Property name |
Description |
Default |
|---|---|---|
|
Hostname or IP address of the kdb+ server. |
|
|
TCP port of the kdb+ server. Must be between 1 and 65535. |
|
|
Username for authenticating with the kdb+ server. If omitted, the connector connects without credentials. |
|
|
Password for authenticating with the kdb+ server. |
Schemas and tables#
The KDB+ connector maps kdb+ namespaces to SEP schemas and kdb+ tables to
SEP tables. The root namespace (tables defined at the top level of a kdb+
process) appears as the default schema in SEP. Named namespaces (for
example, .myns) appear as additional schemas.
The following system namespaces are always excluded from schema discovery
because they contain kdb+ internals rather than user data: q, Q,
h, j, o, s, z.
Table and schema names must consist only of alphanumeric characters and
underscores ([a-zA-Z0-9_]). The connector can’t access names that contain
other characters.
Type mapping#
kdb+ uses single-character type codes internally. The connector maps these codes to Trino types as described in the following table.
kdb+ to Trino type mapping#
kdb+ type code |
kdb+ type name |
Trino type |
Notes |
|---|---|---|---|
|
boolean |
|
Maps directly. kdb+ booleans have no null value. |
|
byte |
|
Maps directly. kdb+ bytes have no null value. |
|
short |
|
|
|
int |
|
|
|
long |
|
|
|
real |
|
IEEE 754 |
|
float |
|
IEEE 754 |
|
char |
|
A single character. The space character ( |
|
char list (string) |
|
kdb+ strings (char lists) map to |
|
symbol |
|
The empty symbol ( |
|
GUID |
|
UUID values are converted to their standard hyphenated string
representation ( |
|
timestamp |
|
Nanosecond-precision timestamps stored relative to the kdb+ epoch
(2000-01-01). The connector converts them to microseconds relative to
the Unix epoch (1970-01-01). A |
|
month |
|
Formatted as |
|
date |
|
Day counts stored relative to the kdb+ epoch (2000-01-01) are
converted to the Unix epoch (1970-01-01). |
|
datetime |
|
Floating-point day fractions relative to the kdb+ epoch, converted
to millisecond-precision Unix timestamps. |
|
timespan |
|
Stored as a raw nanosecond count. |
|
minute |
|
Minutes since midnight as an integer. |
|
second |
|
Seconds since midnight as an integer. |
|
time |
|
Milliseconds since midnight. |
Columns with unsupported types are not visible in SEP.
Note
kdb+ designates a per-type sentinel value to represent NULL because
its columnar storage model does not support nullable wrapper objects.
The connector detects these sentinel values and converts them to SQL
NULL before returning data to SEP.
SQL support#
The connector provides read-only access to kdb+ data. It supports the SELECT
statement only.
Performance#
Pushdown#
The KDB+ connector supports Limit pushdown.
The connector doesn’t support predicate or aggregate pushdown. SEP performs all filtering, aggregation, and sorting after fetching the full table from kdb+. For large tables, this can result in significant data transfer.
To minimize data transfer, query only the columns you need:
-- Preferred: fetch only required columns
SELECT sym, price, ts FROM kdb.default.trades;
-- Avoid: fetches all columns
SELECT * FROM kdb.default.trades;
Security and encryption#
The current release uses an unencrypted TCP connection to kdb+. Deploy the connector only on trusted private networks or over an encrypted tunnel (for example, a VPN or SSH port forward).