# Snowflake prediction job examples
URL: https://docs.datarobot.com/en/docs/classic-ui/predictions/batch/batch-dep/pred-job-examples-snowflake.html

> Configure prediction jobs with Snowflake connections.

# Snowflake prediction job examples

There are two ways to set up a batch prediction job definition for Snowflake:

- Using a JDBC connector with Snowflake as an external data source.
- Using the Snowflake adapter with an external stage .

## JDBC with Snowflake

To complete these examples, follow the steps in [Create a prediction job definition](https://docs.datarobot.com/en/docs/classic-ui/predictions/batch/batch-dep/batch-pred-jobs.html#create-a-prediction-job-definition), using the following procedures to configure JDBC with Snowflake as your prediction source and destination.

### Configure JDBC with Snowflake as source

> [!TIP] Tip
> See [Prediction intake options](https://docs.datarobot.com/en/docs/api/reference/batch-prediction-api/intake-options.html#jdbc-scoring) for field descriptions.

1. ForPrediction source, selectJDBCas theSource typeand click+ Select connection.
2. Select a previously added JDBC Snowflakeconnection.
3. Select your Snowflake account.
4. Select your Snowflake schema.
5. Select the table you want scored and clickSave connection.
6. Continue setting up the rest of the job definition.Scheduleand save the definition. You can also run it immediately for testing.Manage your jobson thePrediction Jobstab.

### Configure JDBC with Snowflake as destination

> [!TIP] Tip
> See [Prediction output options](https://docs.datarobot.com/en/docs/api/reference/batch-prediction-api/output-options.html#jdbc-write) for field descriptions.

1. ForPrediction source, selectJDBCas theDestination typeand click+ Select connection.
2. Select a previously added JDBC Snowflakeconnection.
3. Select your Snowflake account.
4. Select the schema you want to write the predictions to.
5. Select a table or create a new table. If you create a new table, DataRobot creates the table with the proper features, and assigns the correct data type to each feature.
6. Enter the table name and clickSave connection.
7. Select theWrite strategy. In this case,Insertis selected because the table is new.
8. Continue setting up the rest of the job definition.Scheduleand save the definition. You can also run it immediately for testing.Manage your jobson thePrediction Jobstab.

## Snowflake with an external stage

Before using the Snowflake adapter for job definitions, you need to:

- Set up the Snowflakeconnection.
- Create an external stage for Snowflake, a cloud storage location used for loading and unloading data. You can create anAmazon S3 stageor aMicrosoft Azure stage. You will need your account and authentication keys.

To complete these examples, follow the steps in [Create a prediction job definition](https://docs.datarobot.com/en/docs/classic-ui/predictions/batch/batch-dep/batch-pred-jobs.html#create-a-prediction-job-definition), using the following procedures to configure Snowflake as your prediction source and destination.

### Configure Snowflake with an external stage as source

> [!TIP] Tip
> See [Prediction intake options](https://docs.datarobot.com/en/docs/api/reference/batch-prediction-api/intake-options.html#snowflake-scoring) for field descriptions.

1. ForPrediction source, selectSnowflakeas theSource typeand click+ Select connection.
2. Select a previously added Snowflakeconnection.
3. Select your Snowflake account.
4. Select your Snowflake schema.
5. Select the table you want scored and clickSave connection.
6. Toggle onUse external stageand select yourCloud storage type(Azure or S3).
7. Enter theExternal stageyou created for your Snowflake account. EnableThis external stage requires credentialsand click+ Add credentials.
8. Select your credentials. The completedPrediction sourcesection looks like the following:
9. Continue setting up the rest of the job definition.Scheduleand save the definition. You can also run it immediately for testing.Manage your jobson thePredictionJobs tab.

### Configure Snowflake with an external stage as destination

> [!TIP] Tip
> See [Prediction output options](https://docs.datarobot.com/en/docs/api/reference/batch-prediction-api/output-options.html#snowflake-write) for field descriptions.

1. ForPrediction destination, selectSnowflakeas theDestination typeand click+ Select connection.
2. Select a previously added Snowflakeconnection.
3. Select your Snowflake account.
4. Select your Snowflake schema.
5. Select a table or create a new table. If you create a new table, DataRobot creates the table with the proper features, and assigns the correct data type to each feature.
6. Enter the table name and clickSave connection.
7. Toggle onUse external stageand select yourCloud storage type(Azure or S3).
8. Enter theExternal stageyou created for your Snowflake account. EnableThis external stage requires credentialsand click+ Add credentials.
9. Select your credentials. The completedPrediction destinationsection looks like the following:
10. Continue setting up the rest of the job definition.Scheduleand save the definition. You can also run it immediately for testing.Manage your jobson thePredictionJobs tab.

---
