Skip to content

Commit

Permalink
feat: remove 'on cluster' while alert table
Browse files Browse the repository at this point in the history
  • Loading branch information
CeerDecy committed Feb 26, 2025
1 parent 045f549 commit 5c80105
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ func (p *provider) needTTLUpdate(ttl *retention.TTL, meta *loader.TableMeta) boo
}

func (p *provider) AlterTableTTL(tableName string, meta *loader.TableMeta, ttl *retention.TTL) {
sql := "ALTER TABLE <table> ON CLUSTER '{cluster}' MODIFY TTL <time_key> + INTERVAL <ddl_days> DAY;"
sql := "ALTER TABLE <table> MODIFY TTL <time_key> + INTERVAL <ddl_days> DAY;"
ttlHotDays, ttlDays := ttl.GetHotTTLByDays(), ttl.GetTTLByDays()

if p.Cfg.ColdHotEnable && ttlHotDays > 0 && ttlDays > ttlHotDays {
sql = "ALTER TABLE <table> ON CLUSTER '{cluster}' MODIFY TTL <time_key> + toIntervalDay(<hot_ddl_days>) TO VOLUME 'slow', <time_key> + toIntervalDay(<ddl_days>);"
sql = "ALTER TABLE <table> MODIFY TTL <time_key> + toIntervalDay(<hot_ddl_days>) TO VOLUME 'slow', <time_key> + toIntervalDay(<ddl_days>);"
}
if len(meta.TimeKey) <= 0 {
p.Log.Warnf("failed exec ttl, not time key!!", tableName)
Expand Down

0 comments on commit 5c80105

Please sign in to comment.