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
In ClickHouse, the data type DateTime can optionally be parameterized by precision and timezone. With different parameters, the proper insert can be different. However, our sink is issuing insert without checking these parameters.
When inserting datetime as an integer, it is treated as an appropriately scaled Unix Timestamp (UTC).
Inserting datetime as a decimal will treat it similarly as an integer, except the value before the decimal point is the Unix Timestamp up to and including the seconds, and after the decimal point will be treated as the precision.
When inserting string value as datetime, it is treated as being in column timezone.
In the example below, we created 3 columns using different parameters. For each row t0 = t1 = t2 but note how they require different insert:
Inserting 0 is simple
For integers, t0 requires 3 trailing zeros but t1 and t2 requires 6 trailing zeros.
For string, t0 and t1 requires UTC but t2 requires a local time in that zone.
For decimal, all 3 columns can use the same value in insert. But at least 1 zero is required to differentiate it from integer form.
In ClickHouse, the data type
DateTime
can optionally be parameterized by precision and timezone. With different parameters, the properinsert
can be different.However, our sink is issuinginsert
without checking these parameters.https://clickhouse.com/docs/en/sql-reference/data-types/datetime64
In the example below, we created 3 columns using different parameters. For each row t0 = t1 = t2 but note how they require different
insert
:0
is simplet0
requires 3 trailing zeros butt1
andt2
requires 6 trailing zeros.t0
andt1
requires UTC butt2
requires a local time in that zone.insert
. But at least 1 zero is required to differentiate it from integer form.The text was updated successfully, but these errors were encountered: