ALTER VIEW — modifies the TTL settings of an existing stream view
ALTER VIEW view-name ALTER USING TTL value [time-unit]
ON COLUMN column-name
[BATCH_SIZE
number-of-rows] [MAX_FREQUENCY value]
time-unit: SECONDS | MINUTES | HOURS | DAYS
The ALTER VIEW statement lets you modify the USING TTL clause of a stream view. Note that the ALTER statement can only be used to modify a stream view (not a view on a regular database table) and that you can only change the USING TTL clause.
What's more, although you must specify the entire USING TTL clause including the column specification, you can only change the time value, batch size or maximum frequency. You cannot change the TTL column or add or remove the USING TTL clause entirely. To add a USING TTL clause to a stream view without one, to remove an existing USING TTL clause, or to change the TTL column, you must first drop the view then recreate it (using the DROP VIEW and CREATE VIEW statements).
The following example creates a stream view with a USING TTL clause, then uses ALTER VIEW to reduce the TTL value and change the batch size to 500.
CREATE VIEW logins_per_day
(userid, session_day, total_count)
AS SELECT userid, TRUNCATE(DAY, start_time), count(*)
FROM user_session GROUP BY userid, TRUNCATE(DAY, start_time)
USING TTL 7 DAY ON COLUMN session_day;
ALTER VIEW logins_per_day ALTER USING TTL 3 DAYS ON COLUMN session_day
BATCH_SIZE 500;