Manage Engines
An engine is a Dremio entity that manages compute resources. Each engine has one or more replicas that are created for executing queries. An engine replica consists of a group of executor instances defined by the engine capacity.
When you signed up for Dremio, an organization and a project were automatically created. Each new project has a preview engine. The preview engine, by default, will scale down after 1 hour without a query. As the name suggests, it provides previews of queries and datasets. Unlike other engines, the preview engine cannot be disabled.
If an engine is created with a minimum replica of 0, it remains idle until the first query runs. No executor instances run initially. When you run a query, Dremio allocates executors to your project and starts the engine. Engines automatically start and stop based on query load.
Sizes
Dremio provides a standard executor, which is used in all of our query engine sizes. Query engine sizes are differentiated by the number of executors in a replica. For each size, Dremio provides a default query concurrency, as shown in the table below.
| Replica Size | Executors per Replica | DCUs | Default Concurrency | Max Concurrency |
|---|---|---|---|---|
| 2XSmall | 1 | 16 | 2 | 20 |
| XSmall | 1 | 32 | 4 | 40 |
| Small | 2 | 64 | 6 | 60 |
| Medium | 4 | 128 | 8 | 80 |
| Large | 8 | 256 | 10 | 100 |
| XLarge | 16 | 512 | 12 | 120 |
| 2XLarge | 32 | 1024 | 16 | 160 |
| 3XLarge | 64 | 2048 | 20 | 200 |
States
An engine can be in one of the following states.
| State | Icon | Description |
|---|---|---|
| Running | Represents an enabled engine (replicas are provisioned automatically or running as per the minimum number of replicas configured). You can use this engine for running queries. | |
| Adding Replica | Represents an engine that is scaling up (adding a replica). | |
| Removing Replica | Represents an engine that is scaling down (removing a replica). | |
| Disabling | Represents an engine that is being disabled. | |
| Disabled | Represents a disabled engine (no engine replicas have been provisioned dynamically or there are no active replicas). You cannot use this engine for running queries. | |
| Starting Engine | Represents an engine that is starting (transitioning from the disabled state to the enabled state). | |
| Stopping Engine | Represents an engine that is stopping (transitioning from the enabled state to the disabled state). | |
| Stopped | Represents an enabled engine that has been stopped (zero replicas running). | |
| Deleting | Represents an engine that is being deleted. |
Autoscaling
The autoscaling capability dynamically manages query workload for you based on parameters that you set for the engine. Engine replicas are started and stopped as required to provide a seamless query execution by monitoring the engine replica health.
The following table describes the engine parameters along with their role in autoscaling.
| Parameter | Description |
|---|---|
| Size | The number of executors that make up an engine replica. |
| Max Concurrency | Maximum number of jobs that can be run concurrently on an engine replica. |
| Last Replica Auto-Stop | Time to wait before deleting the last replica if the engine is not in use. Not valid when the minimum engine replicas is 1 or higher. The default value is 2 hours. |
| Enqueued Time Limit | If there are no available resources, the query waits for a period of time that is set by this parameter. When this time limit exceeds, the query gets canceled. You are notified with the timeout during slot reservation error if the query gets canceled due to the query time limit being exceeded. The default value is 5 minutes. |
| Query Runtime Limit | Time a query can run before it is canceled. The default value is 5 minutes. |
| Drain Time Limit | Time until an engine replica continues to run after the engine is resized, disabled, or deleted before it is terminated and the running queries fail. The default value is 30 minutes. If there are no queries running on a replica, the engine is terminated without waiting for the drain time limit. |
For a query that is submitted to execute on an engine, the control plane assigns an engine replica to that query. Replicas are dynamically created and assigned to queries based on the query workload. The control plane observes the query workload and current active engine replicas to determine whether to scale up or scale down replicas. Replica is assigned to the query until the query execution is done. For a given engine, Dremio Cloud does not scale up replicas beyond the configured maximum replicas and it does not scale them down below the configured minimum replicas.
Monitor Engine Health
The Dremio Cloud control plane monitors the engines health and manages unhealthy replicas to provide a seamless query execution experience. The replica nodes send periodic heartbeats to the control plane, which determines their liveness. If a periodic heartbeat is not returned from a replica node, the control plane marks that node as unhealthy and replaces it with a healthy one.
View All Engines
To view engines:
- In the Dremio Cloud application, click the Project Settings
icon in the side navigation bar. - Select Engines in the project settings sidebar to see the list of engines in the project. On the Engines page, you can also see engines as per the status. Click the Status dropdown list to see the different statuses.
Add an Engine
To add a new engine:
- On the Project Settings page, select Engines in the project settings sidebar. The Engines page lists the engines created for the project. Every engine created in a project is created in the cloud account associated with that project.
- Click the Add Engine button on the top-right of the Engines page to create a new engine.
- In the Add Engine dialog, for Engine, enter a name.
- (Optional) For Description, enter a description.
- (Optional) For Size, select the size of the engine. The size designates the number of executors.
- (Optional) For Max Concurrency per Replica, enter the maximum number of jobs that can be run concurrently on this engine.
The following parameters are for Engine Replicas:
- For Min Replicas, enter the minimum number of engine replicas that Dremio Cloud has running at any given time. For auto-stop, set it to 0. To guarantee low-latency query execution, set it to 1 or higher. The default number of minimum replicas is 0.
- For Max Replicas, enter the maximum number of engine replicas that Dremio Cloud scales up to. The default number of maximum replicas is 1.
You can use these settings to control costs and ensure that excessive replicas are not spun up.
- Under Advanced Configuration. For Last Replica Auto-Stop, enter the time to wait before deleting the last replica if engine is not in use. The default value is 2 hours, and the minimum value is 1 minute.
The last replica auto stop is not valid when the minimum number of engine replicas is 1 or higher.
The following parameters are for Time Limit:
- For Enable Enqueued Time Limit, check the box.
- For Enqueued Time Limit, enter the time a query waits before being cancelled. The default value is 5 minutes.
You should not set the enqueued time limit to less than one minutes, which is the typical time to start a new replica. Changing this setting does not affect queries that are currently running or queued.
- (Optional) For Enable Query Time Limit, check the box to enable the query time limit for making a query run before it is canceled.
- (Optional) For Query Runtime Limit, enter the time a query can run before it is canceled. The default query runtime limit is 5 minutes.
- For Drain Time Limit, enter the time (in minutes) that an engine replica continues to run after the engine is resized, disabled, or deleted before it is terminated and the running queries fail. The default value is 30 minutes. If there are no queries running on a replica, the engine is terminated without waiting for the drain time limit.
- Click Save and Launch. This action saves the configuration, enables this engine, and allocates the executors.
Edit an Engine
To edit an engine:
- On the Project Settings page, select Engines in the project settings sidebar.
- On the Engines page, hover over the row of the engine that you want to edit and click on the Edit Engine
icon that appears next to the engine. The Edit Engine dialog is opened.
Alternatively, you can click the engine to go to the engine's page. Click the Edit Engine button on the top-right of the page.
You cannot edit the Engine name parameter.
- For Description, enter a description.
- For Size, select the size of the engine. The size designates the number of executors.
- For Max Concurrency per Replica, enter the maximum number of jobs that can be run concurrently on this engine.
The following parameters are for Engine Replicas:
- For Min Replicas, enter the number of engine replicas that Dremio has running at any given time. Set this value to 0 to enable auto-stop, or to 1 or higher to ensure low-latency query execution.
- For Max Replicas, enter the maximum number of engine replicas that Dremio scales up to.
- Under Advanced Configuration. Last Replica Auto-Stop, enter the time to wait before deleting the last replica if the engine is not in use. The default value is 2 hours.
The last replica auto-stop is not valid when the minimum number of engine replicas is 1 or higher.
The following parameters are for Time Limit:
- For Enable Enqueued Time Limit, check the box.
- For Enqueued Time Limit, enter the time a query waits before being canceled. The default value is 5 minutes.
You should not set the enqueued time limit to less than one minutes, which is the typical time to start a new replica. Changing this setting does not affect queries that are currently running or queued.
- (Optional) For Enable Query Time Limit, check the box to enable the query time limit for making a query run before it is canceled.
- (Optional) For Query Runtime Limit, enter the time a query can run before it is canceled. The default query runtime limit is 5 minutes.
- For Drain Time Limit, enter the time (in minutes) that an engine replica continues to run after the engine is resized, disabled, or deleted before it is terminated and any running queries fail. The default value is 30 minutes. If no queries are running on a replica, the engine is terminated without waiting for the drain time limit.
- Click Save.
Disable an Engine
You can disable an engine that is not being used:
To disable the engine:
- On the Project Settings page, select Engines in the project settings sidebar. The list of engines in this project are displayed.
- Disable the engine by using the toggle in the Enabled column.
- Confirm that you want to disable the engine.
Enable an Engine
To enable a disabled engine:
- On the Project Settings page, select Engines in the project settings sidebar. The list of engines in this project are displayed.
- Enable the engine by using the toggle in the Enabled column.
- Confirm that you want to enable the engine.
Delete an Engine
You can permanently delete an engine if it is not in use (this action is irreversible). If queries are running on the engine, then Dremio waits for the drain-time-limit for the running queries to complete before deleting the engine.
An engine that has a routing rule associated with it cannot be deleted. Delete the rules before deleting the engine.
To delete an engine:
- On the Project Settings page, select Engines in the project settings sidebar. The list of engines in this project are displayed.
- On the Engines page, hover over the row of the engine that you want to delete and click the Delete
icon that appears next to the engine. - Confirm that you want to delete the engine.
Configure External Engines
Dremio's Open Catalog is built on Apache Polaris, providing a standards-based, open approach to data catalog management. At its core is the Iceberg REST interface, which enables seamless integration with any query engine that supports the Apache Iceberg REST catalog specification. This open architecture means you can connect industry-standard engines such as Apache Spark, Trino, and Apache Flink directly to Dremio.
By leveraging the Iceberg REST standard, the Open Catalog acts as a universal catalog layer that query engines can communicate with using a common language. This allows organizations to build flexible data architectures where multiple engines can work together, each accessing and managing the same Iceberg tables through Dremio's centralized catalog.
- Apache Spark
- Trino
- Apache Flink
Apache Spark is a unified analytics engine for large-scale data processing, widely used for ETL, batch processing, and data engineering workflows.
Prerequisites
This example uses Spark 3.5.3 with Iceberg 1.9.1. For other versions, ensure compatibility between Spark, Scala, and Iceberg runtime versions. Additional prerequisites include:
- The following JAR files downloaded to your local directory:
authmgr-oauth2-runtime-0.0.5.jarfrom Dremio Auth Manager releases. This open-source library handles token exchange, automatically converting your personal access token (PAT) into an OAuth token for seamless authentication. For more details about Dremio Auth Manager's capabilities and configuration options, see Introducing Dremio Auth Manager for Apache Iceberg.iceberg-spark-runtime-3.5_2.12-1.9.1.jar(from Apache Iceberg releases)iceberg-aws-bundle-1.9.1.jar(from Apache Iceberg releases)
- Docker installed and running.
- Your Dremio catalog name – The default catalog in each project has the same name as the project.
- If authenticating with a PAT, you must generate a token. See Personal Access Tokens for step-by-step instructions.
- If authenticating with an identity provider (IDP), your IDP or other external token provider must be configured as a trusted OAuth external token provider in Dremio.
- You must have an OAuth2 client registered in your IDP configured to issue tokens that Dremio accepts (matching audience and scopes) and with a client ID and client secret provided by your IDP.
Authenticate with a PAT
You can authenticate your Apache Spark session with a Dremio personal access token using the following script. Replace <personal_access_token> with your Dremio personal access token and replace <catalog_name> with your catalog name.
In addition, you can adjust the volume mount paths to match where you've downloaded the JAR files and where you want your workspace directory. The example uses $HOME/downloads and $HOME/workspace.
#!/bin/bash
export CATALOG_NAME="<catalog_name>"
export DREMIO_PAT="<personal_access_token>"
docker run -it \
-v $HOME/downloads:/opt/jars \
-v $HOME/workspace:/workspace \
apache/spark:3.5.3 \
/opt/spark/bin/spark-shell \
--jars /opt/jars/authmgr-oauth2-runtime-0.0.5.jar,/opt/jars/iceberg-spark-runtime-3.5_2.12-1.9.1.jar,/opt/jars/iceberg-aws-bundle-1.9.1.jar \
--conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
--conf spark.sql.catalog.polaris=org.apache.iceberg.spark.SparkCatalog \
--conf spark.sql.catalog.polaris.type=rest \
--conf spark.sql.catalog.polaris.cache-enabled=false \
--conf spark.sql.catalog.polaris.warehouse=$CATALOG_NAME \
--conf spark.sql.catalog.polaris.uri=https://catalog.dremio.cloud/api/iceberg \
--conf spark.sql.catalog.polaris.io-impl=org.apache.iceberg.aws.s3.S3FileIO \
--conf spark.sql.catalog.polaris.header.X-Iceberg-Access-Delegation=vended-credentials \
--conf spark.sql.catalog.polaris.rest.auth.type=com.dremio.iceberg.authmgr.oauth2.OAuth2Manager \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.token-endpoint=https://login.dremio.cloud/oauth/token \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.grant-type=token_exchange \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.client-id=dremio-catalog-cli \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.scope=dremio.all \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.token-exchange.subject-token="$DREMIO_PAT" \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.token-exchange.subject-token-type=urn:ietf:params:oauth:token-type:dremio:personal-access-token
In this configuration, polaris is the catalog identifier used within Spark. This identifier is mapped to your actual Dremio catalog via the spark.sql.catalog.polaris.warehouse property.
Authenticate with an IDP
You can authenticate your Apache Spark session using an external token provider that has been integrated with Dremio.
Using this configuration:
- Spark obtains a user-specific JWT from the external token provider.
- Spark connects to Dremio and exchanges the JWT for an access token.
- Spark connects to the Open Catalog using the access token.
Using the following script, replace <catalog_name> with your catalog name, <idp_url> with the location of your external token provider, <client_id> and <client_secret> with the credentials issued by the external token provider.
In addition, you can adjust the volume mount paths to match where you've downloaded the JAR files and where you want your workspace directory. The example uses $HOME/downloads and $HOME/workspace.
#!/bin/bash
export CATALOG_NAME="<catalog_name>"
export IDP_URL="<idp_url>"
export CLIENT_ID="<idp_client_id>"
export CLIENT_SECRET="<idp_client_secret>"
docker run -it \
-v $HOME/downloads:/opt/jars \
-v $HOME/workspace:/workspace \
apache/spark:3.5.3 \
/opt/spark/bin/spark-shell \
--jars /opt/jars/authmgr-oauth2-runtime-0.0.5.jar,/opt/jars/iceberg-spark-runtime-3.5_2.12-1.9.1.jar,/opt/jars/iceberg-aws-bundle-1.9.1.jar \
--conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
--conf spark.sql.catalog.polaris=org.apache.iceberg.spark.SparkCatalog \
--conf spark.sql.catalog.polaris.type=rest \
--conf spark.sql.catalog.polaris.cache-enabled=false \
--conf spark.sql.catalog.polaris.warehouse=$CATALOG_NAME \
--conf spark.sql.catalog.polaris.uri=https://catalog.dremio.cloud/api/iceberg \
--conf spark.sql.catalog.polaris.io-impl=org.apache.iceberg.aws.s3.S3FileIO \
--conf spark.sql.catalog.polaris.header.X-Iceberg-Access-Delegation=vended-credentials \
--conf spark.sql.catalog.polaris.rest.auth.type=com.dremio.iceberg.authmgr.oauth2.OAuth2Manager \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.issuer-url=$IDP_URL \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.grant-type=device_code \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.client-id=$CLIENT_ID \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.client-secret=$CLIENT_SECRET \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.scope=dremio.all \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.impersonation.enabled=true \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.impersonation.token-endpoint=https://login.dremio.cloud/oauth/token \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.impersonation.scope=dremio.all \
--conf spark.sql.catalog.polaris.rest.auth.oauth2.token-exchange.subject-token-type=urn:ietf:params:oauth:token-type:jwt
Usage Examples
With these configurations, polaris is the catalog identifier used within Spark. This identifier is mapped to your actual Dremio catalog via the spark.sql.catalog.polaris.warehouse property. Once Spark is running and connected to your Dremio catalog:
spark.sql("SHOW NAMESPACES IN polaris").show()
spark.sql("SELECT * FROM polaris.your_namespace.your_table LIMIT 10").show()
spark.sql("""
CREATE TABLE polaris.your_namespace.new_table (
id INT,
name STRING
) USING iceberg
""")
Trino is a distributed SQL query engine designed for fast analytic queries against data sources of all sizes. It excels at interactive SQL analysis, ad hoc queries, and joining data across multiple sources.
Prerequisites
- Docker installed and running.
- A valid Dremio personal access token – See Personal Access Tokens for instructions to generate a personal access token.
- Your Dremio catalog name – The default catalog in each project has the same name as the project.
Configuration
To connect Trino to Dremio using Docker, follow these steps:
-
Create a directory for Trino configuration and add a catalog configuration:
mkdir -p ~/trino-config/catalogIn
Trino polaris.propertiestrino-config/catalog, create a catalog configuration file namedpolaris.propertieswith the following values:connector.name=iceberg
iceberg.catalog.type=rest
iceberg.rest-catalog.uri=https://catalog.dremio.cloud/api/iceberg
iceberg.rest-catalog.oauth2.token=<personal_access_token>
iceberg.rest-catalog.warehouse=<catalog_name>
iceberg.rest-catalog.security=OAUTH2
iceberg.rest-catalog.vended-credentials-enabled=true
fs.native-s3.enabled=true
s3.region=<region>Replace the following:
<personal_access_token>with your Dremio personal access token.<catalog_name>with your catalog name.<region>with the AWS region where your data is stored, such asus-west-2.
note- In this configuration,
polaris(from the filenamepolaris.properties) is the catalog identifier used in Trino queries. Theiceberg.rest-catalog.warehouseproperty maps this identifier to your actual Dremio catalog. - In
oauth2.token, you provide your Dremio personal access token directly. Dremio's catalog API accepts PATs as bearer tokens without requiring token exchange.
-
Pull and start the Trino container:
docker run --name trino -d -p 8080:8080 trinodb/trino:latest -
Verify that Trino is running:
docker psYou can access the web UI at
http://localhost:8080and log in asadmin. -
Restart Trino with the configuration:
docker stop trino
docker rm trino
# Start with mounted configuration
docker run --name trino -d -p 8080:8080 -v ~/trino-config/catalog:/etc/trino/catalog trinodb/trino:latest
# Verify Trino is running
docker ps
# Check logs
docker logs trino -f -
In another window, connect to the Trino CLI:
docker exec -it trino trino --user adminYou should see the Trino prompt:
trino> -
Verify the catalog connection:
trino> show catalogs;
Usage Examples
Once Trino is running and connected to your Dremio catalog:
List namespacestrino> show schemas from polaris;
trino> select * from polaris.your_namespace.your_table;
trino> CREATE TABLE polaris.demo_namespace.test_table (
id INT,
name VARCHAR,
created_date DATE,
value DOUBLE
);
Limitations
- Case sensitivity: Namespace and table names must be in lowercase. Trino will not list or access tables in namespaces that begin with an uppercase character.
- View compatibility: Trino cannot read views created in Dremio due to SQL dialect incompatibility. Returns error: "Cannot read unsupported dialect 'DremioSQL'."
Apache Flink is a distributed stream processing framework designed for stateful computations over bounded and unbounded data streams, enabling real-time data pipelines and event-driven applications.
To connect Apache Flink to Dremio using Docker Compose, follow these steps:
Prerequisites
You'll need to download the required JAR files and organize them in a project directory structure.
-
Create the project directory structure:
mkdir -p flink-dremio/jars
cd flink-dremio -
Download the required JARs into the
jars/directory:-
Iceberg Flink Runtime 1.20:
wget -P jars/ https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-flink-runtime-1.20/1.9.1/iceberg-flink-runtime-1.20-1.9.1.jar -
Iceberg AWS Bundle for vended credentials:
wget -P jars/ https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-aws-bundle/1.9.1/iceberg-aws-bundle-1.9.1.jar -
Hadoop dependencies required by Flink:
wget -P jars/ https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar
-
-
Create the Dockerfile.
Create a file named
Flink DockerfileDockerfilein theflink-dremiodirectory:FROM flink:1.20-scala_2.12
# Copy all required JARs
COPY jars/*.jar /opt/flink/lib/ -
Create the
Flink docker-compose.ymldocker-compose.ymlfile in theflink-dremiodirectory:services:
flink-jobmanager:
build: .
ports:
- "8081:8081"
command: jobmanager
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: flink-jobmanager
parallelism.default: 2
- AWS_REGION=us-west-2
flink-taskmanager:
build: .
depends_on:
- flink-jobmanager
command: taskmanager
scale: 1
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: flink-jobmanager
taskmanager.numberOfTaskSlots: 4
parallelism.default: 2
- AWS_REGION=us-west-2 -
Build and start the Flink cluster:
# Build and start the cluster
docker-compose build --no-cache
docker-compose up -d
# Verify the cluster is running
docker-compose ps
# Verify required JARs are present
docker-compose exec flink-jobmanager ls -la /opt/flink/lib/ | grep -E "(iceberg|hadoop)"You should see the JARs you downloaded in the previous step.
-
Connect to the Flink SQL client:
docker-compose exec flink-jobmanager ./bin/sql-client.shYou can also access the Flink web UI at
http://localhost:8081to monitor jobs. -
Create the Dremio catalog connection in Flink:
CREATE CATALOG polaris WITH (
'type' = 'iceberg',
'catalog-impl' = 'org.apache.iceberg.rest.RESTCatalog',
'uri' = 'https://catalog.dremio.cloud/api/iceberg',
'token' = '<personal_access_token>',
'warehouse' = '<catalog_name>',
'header.X-Iceberg-Access-Delegation' = 'vended-credentials',
'io-impl' = 'org.apache.iceberg.aws.s3.S3FileIO'
);Replace the following:
<personal_access_token>with your Dremio personal access token.<catalog_name>with your catalog name.
note- In this configuration,
polarisis the catalog identifier used in Flink queries. TheCREATE CATALOGcommand maps this identifier to your actual Dremio catalog. - In
token, you provide your Dremio personal access token directly. Dremio's catalog API accepts PATs as bearer tokens without requiring token exchange.
-
Verify the catalog connection:
Flink SQL> show catalogs;
Usage Examples
Once Apache Flink is running and connected to your Dremio catalog:
List namespacesFlink SQL> show databases in polaris;
Flink SQL> select * from polaris.your_namespace.your_table;
Flink SQL> CREATE TABLE polaris.demo_namespace.test_table (
id INT,
name STRING,
created_date DATE,
`value` DOUBLE
);
Limitations
- Reserved keywords: Column names that are reserved keywords, such as
value,timestamp, anddate, must be enclosed in backticks when creating or querying tables.
Troubleshoot
If your engines are not scaling up or down as expected, you can reference the engine events to see the error that is causing the issue.
To view engine events:
- On the Project Settings page, select Engines in the project settings sidebar. The list of engines in this project are displayed.
- On the Engines page, click on the engine that you want to investigate.
- In the engine details page, click on the Events tab to view the scaling events and status of each event.
- If any scaling problems persist, contact Dremio Support.