Download priv/data_migrations/PopulateEventSessionColumns/sql/get-mutations-progress.sql.eex from Leon4gr45/analytics: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/Leon4gr45/analytics/resolve/main/priv/data_migrations/PopulateEventSessionColumns/sql/get-mutations-progress.sql.eex
- Command line
-
hf download hf://spaces/Leon4gr45/analytics/priv/data_migrations/PopulateEventSessionColumns/sql/get-mutations-progress.sql.eex
-
curl -L -o get-mutations-progress.sql.eex https://huggingface.co/spaces/Leon4gr45/analytics/resolve/main/priv/data_migrations/PopulateEventSessionColumns/sql/get-mutations-progress.sql.eex
1.01 kB
| SELECT | |
| total, | |
| length(parts_to_do_names), | |
| running_for_seconds, | |
| formatReadableSize(total_bytes), | |
| formatReadableSize(todo_bytes), | |
| round(100 - todo_bytes / total_bytes * 100, 2), | |
| latest_fail_reason, | |
| sum(part.bytes_on_disk) as total_bytes, | |
| sumIf(part.bytes_on_disk, has(parts_to_do_names, part.name)) AS todo_bytes | |
| FROM ( | |
| SELECT count() AS total, | |
| groupArrayArray(parts_to_do_names) AS parts_to_do_names, | |
| now() - min(create_time) AS running_for_seconds, | |
| anyIf(latest_fail_reason, latest_fail_reason != '') AS latest_fail_reason | |
| FROM system.mutations | |
| WHERE not is_done | |
| AND table = 'events_v2' | |
| AND command ILIKE '%sessions_dict%' | |
| ) AS mut | |
| CROSS JOIN ( | |
| SELECT name, bytes_on_disk | |
| FROM system.parts | |
| WHERE table = 'events_v2' | |
| AND active | |
| AND partition >= '<%= @min_partition %>' | |
| AND partition <= '<%= @max_partition %>' | |
| ) AS part | |
| GROUP BY mut.total, mut.parts_to_do_names, mut.running_for_seconds, mut.latest_fail_reason | |