This reverts commit 8ad45a0592
.
This commit is contained in:
Родитель
e2cc3d1d31
Коммит
d6a55664d0
|
@ -28,16 +28,6 @@ class TemplateResult:
|
|||
query_text: str
|
||||
|
||||
|
||||
APP_PREFIX_CHANNELS = {
|
||||
"firefox_desktop_glam_nightly": "nightly",
|
||||
"firefox_desktop_glam_beta": "beta",
|
||||
"firefox_desktop_glam_release": "release",
|
||||
"org_mozilla_fenix_glam_nightly": "nightly",
|
||||
"org_mozilla_fenix_glam_beta": "beta",
|
||||
"org_mozilla_fenix_glam_release": "release",
|
||||
}
|
||||
|
||||
|
||||
def from_template(
|
||||
query_type: QueryType,
|
||||
template_name: str,
|
||||
|
@ -223,7 +213,11 @@ def main():
|
|||
[
|
||||
table(
|
||||
"latest_versions_v1",
|
||||
**dict(app_id_channel=(f"'{APP_PREFIX_CHANNELS[args.prefix]}'")),
|
||||
**dict(
|
||||
source_table=(
|
||||
f"glam_etl.{args.prefix}__view_clients_daily_scalar_aggregates_v1"
|
||||
)
|
||||
),
|
||||
),
|
||||
init(
|
||||
"clients_scalar_aggregates_v1",
|
||||
|
|
|
@ -1,12 +1,36 @@
|
|||
{{ header }}
|
||||
WITH extracted AS (
|
||||
SELECT
|
||||
client_id,
|
||||
channel,
|
||||
app_version
|
||||
FROM
|
||||
{{ source_table }}
|
||||
WHERE
|
||||
submission_date
|
||||
BETWEEN DATE_SUB(@submission_date, INTERVAL 28 DAY)
|
||||
AND @submission_date
|
||||
AND channel IS NOT NULL
|
||||
),
|
||||
transformed AS (
|
||||
SELECT
|
||||
channel,
|
||||
app_version
|
||||
FROM
|
||||
extracted
|
||||
GROUP BY
|
||||
channel,
|
||||
app_version
|
||||
HAVING
|
||||
COUNT(DISTINCT client_id) > 5
|
||||
ORDER BY
|
||||
channel,
|
||||
app_version DESC
|
||||
)
|
||||
SELECT
|
||||
build.`target`.channel AS channel,
|
||||
MAX(mozfun.norm.extract_version(build.`target`.version,
|
||||
'major')) AS latest_version
|
||||
channel,
|
||||
MAX(app_version) AS latest_version
|
||||
FROM
|
||||
`moz-fx-data-shared-prod.telemetry.buildhub2`
|
||||
WHERE
|
||||
build.`source`.product = "firefox"
|
||||
AND build.`target`.channel = {{ app_id_channel }}
|
||||
transformed
|
||||
GROUP BY
|
||||
build.`target`.channel
|
||||
channel
|
||||
|
|
Загрузка…
Ссылка в новой задаче