ALTER STREAMING TABLE
Applies to: Databricks SQL
Important
This feature is in Public Preview.
Allows you to either:
- Add a schedule for refreshing an existing materialized view or streaming table.
- Alter an existing refresh schedule for a materialized view or streaming table.
- Drop the refresh schedule for a materialized view or streaming table. If the schedule is dropped, the object needs to be refreshed manually to reflect the latest data.
Syntax
ALTER STREAMING TABLE table_name
{
{ ADD | ALTER } SCHEDULE [ REFRESH ]
CRON cron_string [ AT TIME ZONE timezone_id ] |
DROP SCHEDULE
}
Parameters
-
The name of the streaming table to alter the definition of. The name must not include a temporal specification.
SCHEDULE [ REFRESH ] CRON cron_string [ AT TIME ZONE timezone_id ]
If provided, schedules the streaming table or the materialized view to refresh its data with the given quartz cron schedule. Only time_zone_values are accepted.
AT TIME ZONE LOCAL
is not supported. IfAT TIME ZONE
is absent, the session time zone is used. IfAT TIME ZONE
is absent and the session time zone is not set, an error is thrown.SCHEDULE
is semantically equivalent toSCHEDULE REFRESH
.You cannot use the
SCHEDULE
syntax in a Delta Live Tables pipeline definition.
Examples
-- 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 CRON '0 0/15 * * * ? *';
-- Drops the schedule for a streaming table
> ALTER STREAMING TABLE my_st
DROP SCHEDULE;
Related articles
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om