UPDATE_WAREHOUSE_SCHEDULE
Stored procedure UPDATE_WAREHOUSE_SCHEDULE
is a Snowflake stored procedure written in Python that is used to update a warehouse schedule period object.
This procedure is defined in database SUNDECK
(database where Snowflake NativeApp is installed) schema ADMIN
.
ACCOUNTADMIN privilege is required to run this stored procedure.
- See also:
- CREATE_WAREHOUSE_SCHEDULE, DELETE_WAREHOUSE_SCHEDULE, ENABLE_WAREHOUSE_SCHEDULING, DISABLE_WAREHOUSE_SCHEDULING, RESET_WAREHOUSE_SCHEDULING, CREATE_DEFAULT_WAREHOUSE_SCHEDULES
UPDATE_WAREHOUSE_SCHEDULE(<warehouse_name>,
<start_at>,
<finish_at>,
<is_weekday>,
<new_start_at>,
<new_finish_at>,
<size>,
<suspend_minutes>,
<autoscale_mode>
<autoscale_min>
<autoscale_max>
<auto_resume>
<comment>)
First four parameters identify warehouse schedule period to be updated:
<warehouse_name>
- a string that represents warehouse name to be updated.
<start_at>
- schedule period start time of to be updated.
<finish_at>
- schedule period end time to be updated.
<is_weekday>
True
orFalse
for warehouse schedule period to be updated.
Next are the new settings we are updating to:
<new_start_at>
- schedule period start time of to be updated to.
<finish_at>
- schedule period end time to be updated to.
NULL
- if warehouse schedule period was successfully updated.
<error>
- error message string in the case of failure to update warehouse schedule period.
We update start time of the weekday schedule period to start from 18:00 instead of 17:00 and changing warehouse size to Medium.
test#COMPUTE_WH@SUNDECK.ADMIN>select
name,
start_at,
finish_at,
size,
resume,
weekday,
enabled
from
catalog.warehouse_schedules
where
name = 'BATCH' and weekday = True;
+-------+----------+-----------+---------+--------+---------+---------+
| NAME | START_AT | FINISH_AT | SIZE | RESUME | WEEKDAY | ENABLED |
|-------+----------+-----------+---------+--------+---------+---------|
| BATCH | 00:00:00 | 17:00:00 | X-Small | True | True | False |
| BATCH | 17:00:00 | 23:59:00 | Large | True | True | False |
+-------+----------+-----------+---------+--------+---------+---------+
2 Row(s) produced.
nori#COMPUTE_WH@SUNDECK.ADMIN>call ADMIN.UPDATE_WAREHOUSE_SCHEDULE('BATCH', '17:00:00', '23:59:00',
TRUE, '18:00:00', '23:59:00', 'Medium',
0, 'Standard', 0, 0, TRUE, NULL);
+---------------------------+
| UPDATE_WAREHOUSE_SCHEDULE |
|---------------------------|
| NULL |
+---------------------------+
1 Row(s) produced.
nori#COMPUTE_WH@SUNDECK.ADMIN>select
name,
start_at,
finish_at,
size,
resume,
weekday,
enabled
from
catalog.warehouse_schedules
where
name = 'BATCH' and weekday = True;
+-------+----------+-----------+---------+--------+---------+---------+
| NAME | START_AT | FINISH_AT | SIZE | RESUME | WEEKDAY | ENABLED |
|-------+----------+-----------+---------+--------+---------+---------|
| BATCH | 00:00:00 | 18:00:00 | X-Small | True | True | False |
| BATCH | 18:00:00 | 23:59:00 | Medium | True | True | False |
+-------+----------+-----------+---------+--------+---------+---------+
2 Row(s) produced.