docs/content/product/configuration/data-sources/pinot.mdx
Apache Pinot is a real-time distributed OLAP datastore purpose-built for low-latency, high-throughput analytics, and perfect for user-facing analytical workloads. StarTree is a fully-managed platform for Pinot.
Note that the following features should be enabled in your Pinot cluster:
Currently, Apache Pinot is not shown in the list of available data sources in the UI. However, you can still configure it using environment variables.
</ReferenceBox>Add the following to a .env file in your Cube project:
CUBEJS_DB_TYPE=pinot
CUBEJS_DB_HOST=http[s]://pinot.broker.host
CUBEJS_DB_PORT=8099
CUBEJS_DB_USER=pinot_user
CUBEJS_DB_PASS=**********
| Environment Variable | Description | Possible Values | Required |
|---|---|---|---|
| <EnvVar>CUBEJS_DB_HOST</EnvVar> | The host URL for your Pinot broker | A valid host URL | ✅ |
| <EnvVar>CUBEJS_DB_PORT</EnvVar> | The port for the database connection | A valid port number | ✅ |
| <EnvVar>CUBEJS_DB_USER</EnvVar> | The username used to connect to the broker | A valid username | ❌ |
| <EnvVar>CUBEJS_DB_PASS</EnvVar> | The password used to connect to the broker | A valid password | ❌ |
| <EnvVar>CUBEJS_DB_NAME</EnvVar> | The database name for StarTree | A valid name | ❌ |
| <EnvVar>CUBEJS_DB_PINOT_NULL_HANDLING</EnvVar> | If true, enables null handling. Default is false | true, false | ❌ |
| <EnvVar>CUBEJS_DB_PINOT_AUTH_TOKEN</EnvVar> | The authentication token for StarTree | A valid token | ❌ |
| <EnvVar>CUBEJS_CONCURRENCY</EnvVar> | The number of concurrent queries to the data source | A valid number | ❌ |
Measures of type
count_distinct_approx can
be used in pre-aggregations when using Pinot as a source database. To learn more
about Pinot support for approximate aggregate functions, click
here.
To learn more about pre-aggregation build strategies, [head here][ref-caching-using-preaggs-build-strats].
</InfoBox>| Feature | Works with read-only mode? | Is default? |
|---|---|---|
| Simple | ✅ | ✅ |
| Batching | - | - |
| Export bucket | - | - |
By default, Pinot uses a simple strategy to build pre-aggregations.
No extra configuration is required to configure simple pre-aggregation builds for Pinot.
Pinot does not support batching.
Pinot does not support export buckets.
Cube does not require any additional configuration to enable SSL as Pinot connections are made over HTTPS.