You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am going through module 11 of the Clickhouse Developer learning path (Managing Data).
It seems that the TTL definition requires mapping to a column and cannot be done with now()
Steps taken
In the video, at ~07:00, there is
createtablettl_demo_1
(
id Int,
message String
)
engine = MergeTree
order by id
TTL now() + interval 1 month
-- Received exception from server (version 24.10.1):-- Code: 36. DB::Exception: Received from plkgvhe2r3.eu-central-1.aws.clickhouse.cloud:9440. -- DB::Exception: TTL expression now() + toIntervalMonth(1) does not depend on any of the col-- umns of the table. (BAD_ARGUMENTS)
TTL should depends on a table column
In ClickHouse, TTL expressions must depend on at least one column of the table.
This works
createtablettl_demo_1
(
id Int,
message String,
created_at DateTime default now()
)
engine = MergeTree
order by id
TTL created_at + interval 1 month
-- Ok.-- 0 rows in set. Elapsed: 0.174 sec.
I am on a client version 25.3.1.865 and server version 24.10
What’s needed?
Could you please verify my findinds and correct/comment on the training material if needed.
The text was updated successfully, but these errors were encountered:
Analysis: @pkutaj is correct about both the bug (using now() in the TTL table setting is not supported) and the fix (the correct way to do it is setting TTL based on a column that uses now()). Unfortunately, fixing the bug in the course material isn't straightforward. The bug has already been fixed in the latest Developer slides, which correctly use a column for the TTL table setting, so the bug is not present in our ILT material. But the incorrect code is in the On Demand video, both visually (the incorrect code appears on a slide at 06:15) and verbally (Rich's voiceover says at 06:22 "...and look at the end of this table definition, you can see where it says TTL is now() so whenever the row is inserted..."). Fixing the visual in the video is really easy to do, would take me just a few minutes), but the audio is harder.
Possible fixes:
Have Rich or someone else rerecord the entire Module 11 video with the correct code shown and correct verbal description. (The "right" fix.)
Have Rich record a few seconds of audio with the correct narration and splice it in. The splicing is easy, but the sound will very likely be evident to students that it is edited -- my experience is that second recordings never perfectly match original recordings -- the echo and pitch and background noise and whatnot will be noticeably different and sound like a dub. Which isn't necessarily terrible, but it's imperfect.
Leave the audio as-is, correct the code displayed in the slide, and just assume that Rich's narration is "close enough" to what's shown to not confuse students, who will likely depend more on the actual code displayed than the brief audio-over as the "source of truth".
Leave the audio as-is, and add a "errata" indicator to the visual with the correct code, something like this:
Summary/Description
I am going through module 11 of the Clickhouse Developer learning path (Managing Data).
It seems that the TTL definition requires mapping to a column and cannot be done with
now()
Steps taken
TTL
should depends on a table column25.3.1.865
and server version24.10
What’s needed?
Could you please verify my findinds and correct/comment on the training material if needed.
The text was updated successfully, but these errors were encountered: