Download priv/data_migrations/VersionedSessions/sql/create-sessions-tmp-table.sql.eex from Leon4gr45/analytics: direct link, hf CLI and curl.
- Browser
- Download file 551 Bytes
-
https://huggingface.co/spaces/Leon4gr45/analytics/resolve/main/priv/data_migrations/VersionedSessions/sql/create-sessions-tmp-table.sql.eex
- Command line
-
hf download hf://spaces/Leon4gr45/analytics/priv/data_migrations/VersionedSessions/sql/create-sessions-tmp-table.sql.eex
-
curl -L -o create-sessions-tmp-table.sql.eex https://huggingface.co/spaces/Leon4gr45/analytics/resolve/main/priv/data_migrations/VersionedSessions/sql/create-sessions-tmp-table.sql.eex
551 Bytes
| CREATE TABLE sessions_v2_tmp_versioned | |
| <%= if @cluster? do %>ON CLUSTER '{cluster}'<% end %> | |
| AS sessions_v2 | |
| <%= if @cluster? do %> | |
| ENGINE = ReplicatedVersionedCollapsingMergeTree('/clickhouse/{cluster}/tables/{shard}/plausible_prod/sessions_v2_<%= @unique_suffix %>', '{replica}', sign, events) | |
| <% else %> | |
| ENGINE = VersionedCollapsingMergeTree(sign, events) | |
| <% end %> | |
| PARTITION BY toYYYYMM(start) | |
| PRIMARY KEY (site_id, toDate(start), user_id, session_id) | |
| ORDER BY (site_id, toDate(start), user_id, session_id) | |
| SAMPLE BY user_id | |
| <%= @table_settings %> | |