> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake

> Learn how to setup an import job using Snowflake

### Step 1 - Start the Data Upload Wizard

Navigate to the 'Upload Data' page on the left navigation bar in the Arize platform. From there, select the 'Snowflake' card or navigate to the Data Warehouse tab to start a new table import job to begin **a new table import job.**

**Storage Selection:** ❄️ **Snowflake**

<Frame caption="Upload Data Page in Arize">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/f13d857b-image.jpeg" />
</Frame>

### Step 2 - Warehouse Onetime Setup

A [warehouse](https://docs.snowflake.com/en/user-guide/warehouses) is an on-demand, scalable compute cluster used for executing data processing tasks, in this case, connect a warehouse to run queries and sync data from tables relevant to your model.

To gain access to your tables, first configure an initial setup to any **new** Snowflake Warehouse. If you've previously connected your warehouse, skip this step and proceed to specify the [table configuration.](/ax/machine-learning/machine-learning/integrations-ml/snowflake#step-4-configure-the-table-level-permissions)

**In Snowflake**: Copy your Warehouse name

<Frame caption="Warehouses in Snowflake">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/6658880f-image.jpeg" />
</Frame>

**In Arize**: Paste 'Warehouse Name' in the applicable field, and copy the code snippet

<Frame caption="Warehouse Field in Arize">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/e05b0f23-image.jpeg" />
</Frame>

**In Snowflake**: Create a Snowflake '[SQL worksheet](https://docs.snowflake.com/en/user-guide/ui-snowsight-worksheets-gs)'

<Frame caption="Worksheets Tab in Snowflake">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/d1413fc4-image.jpeg" />
</Frame>

**In Snowflake:** Paste code snippet from Arize, select the applicable Warehouse, and **click 'Run All'**

<Frame caption="Example Worksheet to Run All">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/3aff6d44-image.jpeg" />
</Frame>

### Step 3 - Specify Snowflake Table Configuration

Arize requires the following field inputs to enable access permissions.

| Field Name     | Description                                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Account ID** | The account identifier`<organization_name>-<account_name>` (ex. `WOOGSCZ-ZV77179`)                                 |
| **Database**   | The high-level container for storing and organizing your schemas (ex. `COVID19_EPIDEMIOLOGICAL_DATA`)              |
| **Schema**     | The logical container that holds the target table within a database (ex. `PUBLIC`)                                 |
| **Table Name** | The database object that stores structured data in rows and columns that Arize will sync from (ex. `DEMOGRAPHICS`) |

<Frame caption="Field heirarchy in Snowflake">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/2bf70f24-image.jpeg" />
</Frame>

**In Snowflake:** Create an 'Account ID' by combining your \<organization name> with your \<account name>, **separated by a hyphen**. Account information is located at the bottom left of any Snowflake page.

In the example below, the account ID in Arize is`WOOGSCZ-ZV77179`.

<Frame caption="Account information located on the bottom left of any Snowflake page">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/28e173b4-image.jpeg" />
</Frame>

**In Snowflake:** Copy the Database, Schema, and Table Names from the '[Databases](https://docs.snowflake.com/en/guides-overview-db)' tab.

<Frame caption="Snowflake databse information">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/36a912d8-image.jpeg" />
</Frame>

**In Arize:** Input fields to Arize in the 'Dataset Configuration' card

<Frame caption="Dataset configuration in Arize">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/dad1a428-image.jpeg" />
</Frame>

### Step 4 - Configure Table Permissions

Table permissions enable Arize to access, read, and sync your data.

<Info>
  If you don't have the necessary permissions in Snowflake to run the below scripts, please see [Snowflake Permissions Config](/ax/machine-learning/machine-learning/integrations-ml/snowflake/snowflake-permissions-configuration) which specifies the required permissions to setup the connector, which you can pass along to your Snowflake admin.
</Info>

**In Arize**: Copy the code snippet in the "Permissions Configuration" card

<Frame caption="Copy Permissions Configuration in Arize">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/109b6219-image.jpeg" />
</Frame>

**In Snowflake**: Paste the 'Permissions Configuration' code snippet in a Snowflake SQL Worksheet and click 'Run All'. See docs on[granting permissions to Arize's role for Snowflake](https://docs.snowflake.com/en/user-guide/data-exchange-marketplace-privileges).

<Frame caption="Snowflake SQL Worksheet">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/72725e78-image.jpeg" />
</Frame>

### Step 5 - Configure Your Model And Define Your Table's Schema

Match your model schema to your [model type](/ax/machine-learning/machine-learning/api-reference-ml/python-sdk/arize-pandas/utils.types.modeltypes) and define your model schema through the form input or a [json schema](/ax/machine-learning/machine-learning/concepts-ml/model-schema-reference).

<Frame caption="Set up model configurations">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/1c5938c6-image.jpeg" />
</Frame>

<Frame caption="Map your table using a form">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/6ca62695-image.jpeg" />
</Frame>

<Frame caption="Map your table using a JSON schema">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/f39899d4-image.jpeg" />
</Frame>

Learn more about Schema fields [here](/ax/machine-learning/machine-learning/concepts-ml/model-schema-reference#list-of-model-schema-fields-for-data-ingestion-integrations).

Once finished, Arize will begin querying your table and ingesting your records as model inferences.

### Step 6 - Add Model Data To The Table

Arize will run queries to ingest records from your table based on your configured **refresh interval**.

### Step 7 - Check Table Import Job Status

Arize will attempt a dry run to validate your job for any access, schema, or record-level errors. If the dry run is successful, you can proceed to create the import job.

<Frame caption="Successful import job summary">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/e3d234bb-image.jpeg" />
</Frame>

From there, you will be taken to the 'Job Status' tab. where you can see the status of your import jobs. All **active jobs** will regularly sync new data from your data source with Arize. You can view the job details by clicking on the job ID, which reveals more information about the job.

<Frame caption="Job Status tab showing job listings">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/5f0ff9b8-image.jpeg" />
</Frame>

To pause or edit your table schema, click on 'Job Options'.

* **Delete** a job if it is no longer needed or if you made an error connecting to the wrong bucket. This will set your job status as 'deleted' in Arize.

* **Pause** a job if you have a set cadence to update your table. This way, you can 'start job' when you know there will be new data to reduce query costs. This will set your job status as 'inactive' in Arize.

### Step 8 - Troubleshooting An Import Job

An import job may run into a few problems. Use the dry run and job details UI to troubleshoot and quickly resolve data ingestion issues.

#### Validation Errors

If there is an error validating a file or table against the model schema, Arize will surface an **actionable** error message. From there, click on the 'Fix Schema' button to adjust your model schema.

<Frame caption="">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/8b2a6365-image.jpeg" />
</Frame>

#### Dry Run File/Table Passes But The Job Fails

If your dry run is successful, but your job fails, click on the job ID to view the **job details**. This uncovers job details such as information about the file path or query id, the last import job, potential errors, and error locations.

<Frame caption="">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/e41ba027-image.jpeg" />
</Frame>

Once you've identified the job failure point, append the edited row to the end of your table with an updated [change\_timestamp](/ax/machine-learning/machine-learning/integrations-ml/google-bigquery/google-bigquery-faq#how-do-i-update-fix-a-row-that-failed-to-ingest) value.
