Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replays): Add migration for distributed materialization #5951

Merged
merged 2 commits into from
May 28, 2024

Conversation

cmanallen
Copy link
Member

There was a previous PR (https://github.com/getsentry/snuba/pull/5708/files) which added a materialized view to the storage nodes. However, a distributed migration was never run for the query nodes. This PR fixes that.

@cmanallen cmanallen requested a review from a team as a code owner May 21, 2024 20:19
Copy link

github-actions bot commented May 21, 2024

This PR has a migration; here is the generated SQL

-- start migrations

-- forward migration replays : 0020_add_dist_migration_for_materialization
Distributed op: CREATE TABLE IF NOT EXISTS replays_aggregated_dist (project_id UInt64, to_hour_timestamp DateTime, replay_id UUID, retention_days UInt16, browser_name AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), browser_version AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), count_dead_clicks AggregateFunction(sum, UInt64), count_errors AggregateFunction(sum, UInt64), count_infos AggregateFunction(sum, UInt64), count_rage_clicks AggregateFunction(sum, UInt64), count_segments AggregateFunction(count, Nullable(UInt64)), count_urls AggregateFunction(sum, UInt64), count_warnings AggregateFunction(sum, UInt64), device_brand AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), device_family AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), device_model AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), device_name AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), dist AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), environment AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), finished_at AggregateFunction(maxIf, DateTime, UInt8), ip_address_v4 AggregateFunction(any, Nullable(IPv4)), ip_address_v6 AggregateFunction(any, Nullable(IPv6)), is_archived AggregateFunction(sum, Nullable(UInt64)), min_segment_id AggregateFunction(min, Nullable(UInt16)), os_name AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), os_version AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), platform AggregateFunction(anyIf, String, UInt8), sdk_name AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), sdk_version AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), started_at AggregateFunction(min, Nullable(DateTime)), user AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), user_id AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), user_name AggregateFunction(anyIf, Nullable(String), Nullable(UInt8)), user_email AggregateFunction(anyIf, Nullable(String), Nullable(UInt8))) ENGINE Distributed(`cluster_one_sh`, default, replays_aggregated_local);
-- end forward migration replays : 0020_add_dist_migration_for_materialization




-- backward migration replays : 0020_add_dist_migration_for_materialization
Distributed op: DROP TABLE IF EXISTS replays_aggregated_dist;
-- end backward migration replays : 0020_add_dist_migration_for_materialization

@aliu39 aliu39 self-requested a review May 22, 2024 18:00
@cmanallen cmanallen merged commit d12eed1 into master May 28, 2024
30 checks passed
@cmanallen cmanallen deleted the cmanallen/materialize-dist-table branch May 28, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants