Skip to main content
Skip table of contents

PRE

A PRE load step is executed before automatically generated loads steps.


See also:


Usage

OPTION
PRE: sql_code

Notes

PRE steps are used mainly with automatically generated loads but they can also be used with other load step types.

PRE steps can be saved as part of a load template.

PRE steps can use variables inside the SQL code.


Examples

Increase Snowflake warehouse size before a load

Create a PRE step to scale DEMO_WH virtual warehouse up to medium before a load to increase compute capacity:

OPTION
PRE:
 
ALTER WAREHOUSE DEMO_WH 
SET WAREHOUSE_SIZE = 'medium' 
AUTO_SUSPEND = 300 
AUTO_RESUME = TRUE 
MIN_CLUSTER_COUNT = 1 
MAX_CLUSTER_COUNT = 1 
COMMENT = 'standard-server warehouse for ETL and most analytics';

SQL executed before the load:

SQL
ALTER WAREHOUSE DEMO_WH
SET WAREHOUSE_SIZE = 'medium' 
AUTO_SUSPEND = 300 
AUTO_RESUME = TRUE 
MIN_CLUSTER_COUNT = 1 
MAX_CLUSTER_COUNT = 1 
COMMENT = 'standard-server warehouse for ETL and most analytics';

Use a specific Snowflake warehouse for a load

Create a PRE step to use a specific Snowflake warehouse for a load:

OPTION
PRE:
 
USE WAREHOUSE WH_EXAMPLE;

SQL executed before the load:

SQL
USE WAREHOUSE WH_EXAMPLE;

Agile Data Engine creates a session per load. Therefore, session specific commands executed as a PRE step are in effect for all load steps in a load unless overridden in later steps.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.