


CREATE TABLE table_rename_with_ttl
(
  date1 Date,
  date2 Date,
  value1 String,
  value2 String TTL date1 + INTERVAL 500 MONTH
)
ENGINE = ReplicatedMergeTree('/clickhouse/{database}/test_01213/table_rename_with_ttl', '1')
ORDER BY tuple()
TTL date2 + INTERVAL 500 MONTH;

SELECT * FROM table_rename_with_ttl WHERE value1 = '1' FORMAT TSVWithNames;

SHOW CREATE TABLE table_rename_with_ttl;

ALTER TABLE table_rename_with_ttl RENAME COLUMN date1 TO renamed_date1;

SELECT * FROM table_rename_with_ttl WHERE value1 = '1' FORMAT TSVWithNames;

SHOW CREATE TABLE table_rename_with_ttl;

ALTER TABLE table_rename_with_ttl RENAME COLUMN date2 TO renamed_date2;

SELECT * FROM table_rename_with_ttl WHERE value1 = '1' FORMAT TSVWithNames;

SHOW CREATE TABLE table_rename_with_ttl;

