0

I'd like to define a custom variable called task_warehouse to be used in a Snowflake change script, like this:

CREATE OR REPLACE TASK dummy_task
    WAREHOUSE = &task_warehouse
    SCHEDULE = '1 minute'
    AS
        SELECT 1;

The task warehouse is different from &warehouse. I want the task warehouse to vary depending on the DATABASE being deployed to. I don't want to change the warehouse that's running the deploy script.

I tried adding ;task_warehouse=<WAREHOUSE_NAME> to the Snowflake connection string, but that didn't seem to do the trick.

I get this error when trying to deploy:

Variable task_warehouse is not defined

Does anyone know how to define a custom variable to be used by Sqitch, similar to how &warehouse is used in the following?

USE WAREHOUSE &warehouse;
Martin
  • 41
  • 1
  • 5

1 Answers1

0

One of my colleagues was able to figure it out. It says under the "variables" bullet towards the bottom of https://sqitch.org/docs/manual/sqitch-configuration/.

Example from that page:

sqitch deploy --set $key=$val -s $key2=$val2

Doing the following worked for me:

sqitch deploy -s task_warehouse=PROD_TASK_WAREHOUSE
Martin
  • 41
  • 1
  • 5