Skip to content

Commit 95616b6

Browse files
committed
chore: better comment
1 parent 69a48d4 commit 95616b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/cubejs-schema-compiler/src/adapter/ClickHouseQuery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ export class ClickHouseQuery extends BaseQuery {
112112
}
113113

114114
public dateTimeCast(value: string, timezone?: string): string {
115-
// If a timezone is specified, use toDateTime64 to parse the string AS IF it's in that timezone
116-
// This is critical for custom granularity, because timezone should be aligned between origin and source column
115+
// This is critical for custom granularity, because timezone should be aligned between origin and source column, otherwise
116+
// clickhouse will align the source column to the origin timezone, which will cause an unintended offset.
117117
if (timezone) {
118118
// Use precision 3 for milliseconds to match the format 'YYYY-MM-DDTHH:mm:ss.SSS'
119119
return `toDateTime64(${value}, 3, '${timezone}')`;

0 commit comments

Comments
 (0)