Skip to content

Commit

Permalink
Switched to DateTime64(UTC) for timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWanderer committed Mar 8, 2023
1 parent 798c568 commit 7989482
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions guide-sharding-and-replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CREATE DATABASE IF NOT EXISTS jaeger ON CLUSTER '{cluster}' ENGINE=Atomic;
USE jaeger;
CREATE TABLE IF NOT EXISTS jaeger_spans_local ON CLUSTER '{cluster}' (
timestamp DateTime CODEC(Delta, ZSTD(1)),
timestamp DateTime64(3, 'UTC') CODEC(Delta, ZSTD(1)),
traceID String CODEC(ZSTD(1)),
model String CODEC(ZSTD(3))
) ENGINE ReplicatedMergeTree
Expand All @@ -95,7 +95,7 @@ ORDER BY traceID
SETTINGS index_granularity=1024;
CREATE TABLE IF NOT EXISTS jaeger_index_local ON CLUSTER '{cluster}' (
timestamp DateTime CODEC(Delta, ZSTD(1)),
timestamp DateTime64(3, 'UTC') CODEC(Delta, ZSTD(1)),
traceID String CODEC(ZSTD(1)),
service LowCardinality(String) CODEC(ZSTD(1)),
operation LowCardinality(String) CODEC(ZSTD(1)),
Expand Down
2 changes: 1 addition & 1 deletion sqlscripts/jaeger-index.tmpl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS {{.SpansIndexTable}}
{{if .Multitenant -}}
tenant LowCardinality(String) CODEC (ZSTD(1)),
{{- end -}}
timestamp DateTime CODEC (Delta, ZSTD(1)),
timestamp DateTime64(3, 'UTC') CODEC (Delta, ZSTD(1)),
traceID String CODEC (ZSTD(1)),
service LowCardinality(String) CODEC (ZSTD(1)),
operation LowCardinality(String) CODEC (ZSTD(1)),
Expand Down
2 changes: 1 addition & 1 deletion sqlscripts/jaeger-spans-archive.tmpl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS {{.SpansArchiveTable}}
{{if .Multitenant -}}
tenant LowCardinality(String) CODEC (ZSTD(1)),
{{- end -}}
timestamp DateTime CODEC (Delta, ZSTD(1)),
timestamp DateTime64(3, 'UTC') CODEC (Delta, ZSTD(1)),
traceID String CODEC (ZSTD(1)),
model String CODEC (ZSTD(3))
) ENGINE {{if .Replication}}ReplicatedMergeTree{{else}}MergeTree(){{end}}
Expand Down
2 changes: 1 addition & 1 deletion sqlscripts/jaeger-spans.tmpl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS {{.SpansTable}}
{{if .Multitenant -}}
tenant LowCardinality(String) CODEC (ZSTD(1)),
{{- end -}}
timestamp DateTime CODEC (Delta, ZSTD(1)),
timestamp DateTime64(3, 'UTC') CODEC (Delta, ZSTD(1)),
traceID String CODEC (ZSTD(1)),
model String CODEC (ZSTD(3))
) ENGINE {{if .Replication}}ReplicatedMergeTree{{else}}MergeTree(){{end}}
Expand Down
2 changes: 1 addition & 1 deletion storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func runInitScripts(logger hclog.Logger, db *sql.DB, cfg Configuration) error {
ttlDate string
)
if cfg.TTLDays > 0 {
ttlTimestamp = fmt.Sprintf("TTL timestamp + INTERVAL %d DAY DELETE", cfg.TTLDays)
ttlTimestamp = fmt.Sprintf("TTL toDateTime(timestamp) + INTERVAL %d DAY DELETE", cfg.TTLDays)
ttlDate = fmt.Sprintf("TTL date + INTERVAL %d DAY DELETE", cfg.TTLDays)
}
if cfg.InitSQLScriptsDir != "" {
Expand Down

0 comments on commit 7989482

Please sign in to comment.