CUBEJS_DB_DUCKDB_DATABASE_PATH environment variable to
connect to a local DuckDB database.
Prerequisites
- A set of IAM credentials which allow access to the S3-compatible data source. Credentials are only required for private S3 buckets.
- The region of the bucket
- The name of a bucket to query data from
Setup
Manual
Add the following to a.env file in your Cube project:
Cube Cloud
In Cube Cloud, select DuckDB when creating a new deployment and fill in the required fields:If you are not using MotherDuck, leave the MotherDuck Token
field blank.
You can also explore how DuckDB works with Cube if you create a demo
deployment in Cube Cloud.
Environment Variables
Pre-Aggregation Feature Support
count_distinct_approx
Measures of typecount_distinct_approx can
be used in pre-aggregations when using DuckDB as a source database. To learn
more about DuckDB’s support for approximate aggregate functions, click
here.
Pre-Aggregation Build Strategies
To learn more about pre-aggregation build strategies, head
here.
By default, DuckDB uses a batching strategy to build
pre-aggregations.