analytics/priv/data_migrations/VersionedSessions/sql
Karl-Aksel Puulmann 8ba2b934b3
Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802)
* Add data migration for moving to VersionedCollapsingMergeTree

This has been tested locally and partially on staging. Still requires a bit of work to verify.

Verification query:

```
SELECT main._partition_id, tmp.count, main.count
FROM (
SELECT _partition_id, count() AS count
FROM sessions_v2_tmp_versioned
GROUP BY _partition_id
) AS tmp
FULL OUTER JOIN (
SELECT _partition_id, count() AS count
FROM sessions_v2
GROUP BY _partition_id
) AS main
ON (tmp._partition_id == main._partition_id)
ORDER BY main._partition_id
```

* Add an early exit to migration

* cluster? extract common code
2024-02-22 09:54:39 +02:00
..
attach-partition.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00
check-replicas.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00
create-sessions-tmp-table.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00
drop-sessions-tmp-table.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00
exchange-sessions-tables.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00
get-sessions-table-settings.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00
list-partitions.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00
rename-table.sql.eex Add data migration for moving sessions_v2 table to VersionedCollapsingMergeTree (#3802) 2024-02-22 09:54:39 +02:00