# Create a Compute Pool to Work with Iceberg

A compute pool is a set of dedicated resources to run batch queries.  Compute pools are Apache Spark clusters you use to perform real-time analytics on data you read from Iceberg tables.  They are similar to Databricks’ [all-purpose compute](https://docs.databricks.com/aws/en/compute/use-compute).&#x20;

However, you never have to manage or interact with Spark directly.  DeltaStream auto-configures and instantiates the pool based on a pool size you select.

[More on Compute Pools](https://docs.deltastream.io/overview/core-concepts/compute-pools).

## Creating a Compute Pool

You create a compute pool much like you’d create any new DeltaStream object.  Define it at the organization level and follow the same access control rules.  Specific to compute pools, however, you also must select a pool size – S, M, or L. &#x20;

{% hint style="info" %}
**Note**   You do not need a compute pool if you are only writing to Iceberg – if, for example, you’re streaming filtered Kafka data into Iceberg tables.  Compute pools are necessary only if you wish to read from/query Iceberg data.
{% endhint %}

### Working with Compute Pools via the DeltaStream UI

#### To create a compute pool

1. In the lefthand navigation, click **Resources** ( ![](https://1288764042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdbd9e6ZJodkgF1H6AVay%2Fuploads%2Fgit-blob-b8a3f3aca0b7459aa58df4a07a41134959fbe33f%2FResourcesIcon.png?alt=media) ) to display the **Resources** page.
2. Click to activate the **Compute Pools** tab.  Then click **+ Add Compute Pool**.<br>

   <figure><img src="https://1288764042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdbd9e6ZJodkgF1H6AVay%2Fuploads%2FMjnIb7Bce862AAkFRKEX%2FComputePoolTabsHighlighted.png?alt=media&#x26;token=f2b1ce9a-b1f2-42bf-9cac-6a5627f06751" alt="" width="563"><figcaption></figcaption></figure>
3. When the **Add Compute Pool** window displays, enter the required information.
   1. To specify a pool size, click the **Pool Size** down arrow and select from **Small**, **Medium**, or **Large**.
4. Compute pools by default shut off automatically after 60 minutes of inactivity.  To change this value, click to activate the **Enable Auto-Stop** slider, then use the arrows to specify a different auto-shutoff length.&#x20;
5. Click **Add**.  The **Resources** page redisplays, with your new pool added to the list of pools under the **Compute Pools** tab.&#x20;

After you create a compute pool, you can perform multiple actions:

* Edit its pool size and auto-shutoff interval
* Stop it
* Delete it
* View a full history of its activity.

You can access these actions in either of 2 ways:

1. Right-click on the compute pool you want and select from the context menu.<br>

   <figure><img src="https://1288764042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdbd9e6ZJodkgF1H6AVay%2Fuploads%2F0OmL8eDpaUdk1sUthk72%2FComputePoolContextMenu.png?alt=media&#x26;token=7cee3953-f00d-4d12-ae37-c78633e7b7b6" alt="" width="241"><figcaption></figcaption></figure>
2. On the right, under the **Action** column, click the desired icon.

<figure><img src="https://1288764042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdbd9e6ZJodkgF1H6AVay%2Fuploads%2FncVnLWjtajnwwNWosNRl%2FComputePoolActionMenu.png?alt=media&#x26;token=fb2e502d-e70d-41d8-80ae-cd3ef2fbc41f" alt="" width="563"><figcaption></figcaption></figure>

We'll use the right-click context menu to navigate for the next few procedures, but you can instead click an icon, if you prefer. &#x20;

**To edit a compute pool size and auto-shutoff interval**

1. Right-click the compute pool, and from the menu that displays click **Edit `<computepool name>`**
2. Make the changes you wish, and then click **Update**.

**To stop or start a compute pool**

* Right-click the compute pool, and from the menu that displays click **Stop.**

The compute pool redisplays with a Status of **Stopped**.  Repeat this step to re-start the compute pool.

**To delete a compute pool**

1. Right-click the compute pool, and from the menu that displays click **Delete.**
2. When the Delete Compute Pool box displays, follow the instructions and then click **Delete**.

**To view compute pool activity**

1. Right-click the compute pool, and from the menu that displays click **View Details.**\
   The **Details** pane displays on the right, with the **Overview** tab open.  This tab only displays basic information (owner, status, and created/modified dates).displays, which&#x20;
2. To view the complete history of this compute pool (created time, started/stopped time, ownership, and so on), click the **Details** tab.<br>

   <figure><img src="https://1288764042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdbd9e6ZJodkgF1H6AVay%2Fuploads%2FcwBqw1CYUSAY4ILx5mmj%2FComputePoolDetailsRachelDemo.png?alt=media&#x26;token=ec85f8d8-78b7-4435-b133-28f81efcb446" alt="" width="180"><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important**   Creating a compute pool essentially is a prerequisite for reading from/querying Iceberg tables.  Please see [iceberg-rest-catalog](https://docs.deltastream.io/integrations/setting-up-data-store-integrations/iceberg-rest-catalog "mention") or [iceberg-aws-glue-catalog](https://docs.deltastream.io/integrations/setting-up-data-store-integrations/iceberg-aws-glue-catalog "mention") for detailed instructions on setting up Iceberg tables to work with DeltaStream.
{% endhint %}

### Working with Compute Pools via the DeltaStream CLI&#x20;

Follow the links below for instructions on using the DeltaStream SQL DDL to create and manage compute pools:&#x20;

[Create Compute\_Pool](https://docs.deltastream.io/reference/sql-syntax/ddl/create-compute_pool)

[Update Compute\_Pool](https://docs.deltastream.io/reference/sql-syntax/ddl/update-compute_pool)

[Create Store](https://docs.deltastream.io/reference/sql-syntax/ddl/create-store)

[List Compute\_Pool](https://docs.deltastream.io/reference/sql-syntax/command/list-compute_pools)

[Drop Compute\_Pool](https://docs.deltastream.io/reference/sql-syntax/ddl/drop-compute_pool)

[Start Compute\_Pool](https://docs.deltastream.io/reference/sql-syntax/command/start-compute_pool)

[Stop Compute\_Pool](https://docs.deltastream.io/reference/sql-syntax/command/stop-compute_pool)
