Create and assign a warehouse to a user

A warehouse in CelerData Cloud Serverless is an independent group of compute nodes that can provide with you the required compute resources (CPU, memory, and temporary storage) for SQL execution. Each warehouse can be suspended, resumed, and scaled on demand.

This topic describes how to create a warehouse and assign it to a user.

Prerequisites

You must have and activate the cluster_admin role to perform this operation.

Process

Follow these steps to create a warehouse and assign it to a user:

  1. Sign in to the CelerData Cloud Serverless console.

  2. In the left-side navigation pane, choose Warehouse.

  3. On the page that appears, click Add warehouse.

  4. In the dialog box that appears, configure the following parameters and click Create:

    • Warehouse name: Enter a name for the warehouse.
    • Description: Optionally enter a description for the warehouse.
    • Warehouse size: Select a size for the warehouse. Each warehouse size represents a specific amount of compute resources.
    • Advanced Setting: Configure the Auto Suspend feature for the warehouse.

    Creating a warehouse takes a few minutes.

    img

  5. After the warehouse is successfully created, choose SQL Editor in the left-side navigation pane.

  6. From the drop-down list in the upper-right corner of the editor, select a warehouse in the Running state. If the warehouse is suspended, click Quick resume next to the warehouse to resume the warehouse.

    TIPS

    • Only warehouses in the Running state can be used to execute SQL statements, and only users with an activated cluster_admin role can resume a suspended warehouse.
    • You can find the new warehouse you have just created in the drop-down list.
    • You can execute SHOW WAREHOUSES; in the editor to list the warehouses in your account and their status.
  7. Copy the following statement and paste it to the editor, configure the variables as noted in the comments, and click Run:

    -- Replace <warehouse_name> with the name of the warehouse you created.
    -- Replace <username> with the user to whom you want to grant the warehouse USAGE privilege.
    GRANT USAGE ON WAREHOUSE <warehouse_name> TO <username>;

    This statement grants the USAGE privilege of the warehouse to the specified user.

    img