Skip to content

Commit 39c3e7f

Browse files
committed
WKBCH-18: Change startTime column type to Int64
Store timestamps as epoch milliseconds (Int64) instead of DateTime64(3) for consistent handling across ingest, storage, and offsets tables.
1 parent 3b4959a commit 39c3e7f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

templates/clickhouse/init.d/02-create-ingest-table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS logs.access_logs_ingest
55
hostname LowCardinality(Nullable(String)),
66

77
-- AWS access server logs fields https://docs.aws.amazon.com/AmazonS3/latest/userguide/LogFormat.html
8-
startTime DateTime64(3), -- AWS "Time" field
8+
startTime Int64, -- AWS "Time" field (epoch milliseconds)
99
requester Nullable(String),
1010
operation Nullable(String),
1111
requestURI Nullable(String),

templates/clickhouse/init.d/03-create-storage-table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS logs.access_logs
55
hostname LowCardinality(Nullable(String)),
66

77
-- AWS access server logs fields https://docs.aws.amazon.com/AmazonS3/latest/userguide/LogFormat.html
8-
startTime DateTime64(3), -- AWS "Time" field
8+
startTime Int64, -- AWS "Time" field (epoch milliseconds)
99
requester Nullable(String),
1010
operation Nullable(String),
1111
requestURI Nullable(String),

templates/clickhouse/init.d/04-create-offsets-table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS logs.offsets
33
bucketName String,
44
raftSessionID UInt16,
55
lastProcessedInsertedAt DateTime,
6-
lastProcessedStartTime DateTime64(3),
6+
lastProcessedStartTime Int64,
77
lastProcessedReqId String
88
)
99
ENGINE = ReplacingMergeTree(lastProcessedInsertedAt)

0 commit comments

Comments
 (0)