itinycheng / flink-connector-clickhouse

Flink SQL connector for ClickHouse. Support ClickHouseCatalog and read/write primary data, maps, arrays to clickhouse.
Apache License 2.0
374 stars 156 forks source link

cast(timestamp as timestamp with local time zone) return the same value as input arg #4

Closed liyubin117 closed 2 years ago

liyubin117 commented 2 years ago

in fact, at UTC+8 time zone, should return input arg - 8 hour

itinycheng commented 2 years ago

in fact, at UTC+8 time zone, should return input arg - 8 hour

I did a test:

image

I think TIMESTAMP '2021-12-02 00:00:00' create a timestamp without time zone or UTC time, its millisecond is 1638403200000, its display with timezone +8 is 2021-12-02 08:00:00;

cast(TIMESTAMP '2021-12-02 00:00:00' as timestamp with local time zone) will change the timezone to match table context, the millisecond will change to 1638374400000, but the time display won't change, so the result write to ClickHouse should also be 2021-12-02 00:00:00 if ClickHouse has the same timezone.

Am I wrong?