Skip to main content

Prerequisites

  • The hostname for the Presto database server
  • The username/password for the Presto database server
  • The name of the database to use within the Presto database server

Setup

Manual

Add the following to a .env file in your Cube project:

Environment Variables

Pre-Aggregation Feature Support

count_distinct_approx

Measures of type count_distinct_approx can be used in pre-aggregations when using Presto as a source database. To learn more about Presto support for approximate aggregate functions, click here.

Pre-Aggregation Build Strategies

To learn more about pre-aggregation build strategies, head here.
By default, Presto uses a simple strategy to build pre-aggregations.

Simple

No extra configuration is required to configure simple pre-aggregation builds for Presto.

Export Bucket

Presto supports using both AWS S3 and Google Cloud Storage for export bucket functionality.

AWS S3

Ensure the AWS credentials are correctly configured in IAM to allow reads and writes to the export bucket in S3.

Google Cloud Storage

When using an export bucket, remember to assign the Storage Object Admin role to your Google Cloud credentials (CUBEJS_DB_EXPORT_GCS_CREDENTIALS).

SSL

To enable SSL-encrypted connections between Cube and Presto, set the CUBEJS_DB_SSL environment variable to true. For more information on how to configure custom certificates, please check out Enable SSL Connections to the Database.

Custom headers

The Presto driver supports forwarding custom HTTP headers on every request to the Presto coordinator. This is useful for setting headers like X-Presto-Source, X-Presto-Client-Tags, or any other custom header your Presto coordinator expects. Custom headers can’t be configured via environment variables. Instead, use the driver_factory configuration option to pass a headers object to the driver:
In multitenant deployments, you can use the security context to pass per-tenant headers, for example to forward a user token from the API request down to Presto: