Training
Module
Implement streaming architecture patterns with Delta Live Tables - Training
Learn about structured streaming with Delta Live Tables
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to: Databricks SQL
Allows you to either:
To add or alter a comment on a table or its columns, use COMMENT ON.
ALTER STREAMING TABLE table_name
{
{ ADD | ALTER } SCHEDULE [ REFRESH ] schedule_clause |
DROP SCHEDULE
}
schedule_clause
{ EVERY number { HOUR | HOURS | DAY | DAYS | WEEK | WEEKS } |
CRON cron_string [ AT TIME ZONE timezone_id ] }
The name of the streaming table to alter the definition of. The name must not include a temporal specification.
SCHEDULE [ REFRESH ] schedule_clause
Allows you to add a schedule to or alter the schedule of a streaming table.
EVERY number { HOUR | HOURS | DAY | DAYS | WEEK | WEEKS }
To schedule a refresh that occurs periodically, use EVERY
syntax. If EVERY
syntax is specified, the streaming table or materialized view is refreshed periodically at the specified interval based on the provided value, such as HOUR
, HOURS
, DAY
, DAYS
, WEEK
, or WEEKS
.
The following table lists accepted integer values for number
.
Time unit | Integer value |
---|---|
HOUR or HOURS |
1 <= H <= 72 |
DAY or DAYS |
1 <= D <= 31 |
WEEK or WEEKS |
1 <= W <= 8 |
Note
The singular and plural forms of the included time unit are semantically equivalent.
CRON cron_string [ AT TIME ZONE timezone_id ]
To schedule a refresh using a quartz cron value. Valid time_zone_values are accepted. AT TIME ZONE LOCAL
is not supported.
If AT TIME ZONE
is absent, the session time zone is used.
If AT TIME ZONE
is absent and the session time zone is not set, an error is thrown.
SCHEDULE
is semantically equivalent to SCHEDULE REFRESH
.
-- Adds a schedule to refresh the streaming table once a day
-- at midnight in Los Angeles
> ALTER STREAMING TABLE my_st
ADD SCHEDULE CRON '0 0 0 * * ? *' AT TIME ZONE 'America/Los_Angeles';
-- Alters the schedule to run every 15 minutes for a streaming table
> ALTER STREAMING TABLE my_st
ALTER SCHEDULE EVERY 15 MINUTES;
-- Drops the schedule for a streaming table
> ALTER STREAMING TABLE my_st
DROP SCHEDULE;
Training
Module
Implement streaming architecture patterns with Delta Live Tables - Training
Learn about structured streaming with Delta Live Tables