Skip to content

Commit 8bd61d5

Browse files
committed
Migrate sorting key of analytics-events
1 parent c0ce093 commit 8bd61d5

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
TB_VERSION_WARNING=0
2-
VERSION=2.0.1
2+
VERSION=3.0.0

change_sorting_key_landing_data_source/datasources/analytics_events.datasource

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ SCHEMA >
1111
`payload` String `json:$.payload`
1212

1313
ENGINE MergeTree
14-
ENGINE_PARTITION_KEY toYYYYMM(timestamp)
15-
ENGINE_SORTING_KEY timestamp, action, version
14+
ENGINE_PARTITION_KEY toYYYYMMDD(timestamp)
15+
ENGINE_SORTING_KEY timestamp
1616
ENGINE_TTL timestamp + toIntervalDay(60)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
NODE syncing_data
2+
SQL >
3+
%
4+
SELECT *
5+
FROM v2_0_1.analytics_events
6+
WHERE timestamp BETWEEN {{DateTime(start)}} AND {{DateTime(end)}}
7+
8+
TYPE COPY
9+
TARGET_DATASOURCE analytics_events
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
NODE syncing_data
2+
SQL >
3+
SELECT *
4+
FROM v2_0_1.analytics_events
5+
WHERE timestamp > '2024-02-07 16:00:00'
6+
7+
TYPE MATERIALIZED
8+
DATASOURCE analytics_events

0 commit comments

Comments
 (0)