Skip to content

Commit a46e060

Browse files
committed
Use fixed column order in baseline_clients_last_seen
1 parent f6867ca commit a46e060

File tree

1 file changed

+66
-10
lines changed

1 file changed

+66
-10
lines changed

sql_generators/glean_usage/templates/baseline_clients_last_seen_v1.query.sql

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,38 @@ WITH _current AS (
4444
CAST(browser_engagement_uri_count > 0 AS INT64) &
4545
CAST(browser_engagement_active_ticks > 0 AS INT64) AS days_desktop_active_bits,
4646
{% endif %}
47-
* EXCEPT(submission_date)
47+
client_id,
48+
sample_id,
49+
first_run_date,
50+
durations,
51+
days_seen_session_start_bits,
52+
days_seen_session_end_bits,
53+
normalized_channel,
54+
normalized_os,
55+
normalized_os_version,
56+
android_sdk_version,
57+
locale,
58+
city,
59+
country,
60+
isp,
61+
app_build,
62+
app_channel,
63+
app_display_version,
64+
architecture,
65+
device_manufacturer,
66+
device_model,
67+
telemetry_sdk_build,
68+
first_seen_date,
69+
is_new_profile,
70+
distribution_id,
71+
geo_subdivision,
72+
profile_group_id,
73+
install_source,
74+
windows_build_number,
75+
browser_engagement_uri_count,
76+
browser_engagement_active_ticks,
77+
legacy_telemetry_client_id,
78+
is_default_browser,
4879
FROM
4980
`{{ daily_table }}`
5081
WHERE
@@ -54,21 +85,46 @@ WITH _current AS (
5485
--
5586
_previous AS (
5687
SELECT
88+
-- All columns except submission_date ( * (EXCEPT(submission_date)) )
89+
-- listed out to ensure order is identical to output of _current
5790
days_seen_bits,
5891
days_active_bits,
5992
{% if app_name == "firefox_desktop" %}
6093
days_desktop_active_bits,
6194
{% endif %}
6295
days_created_profile_bits,
63-
* EXCEPT (
64-
submission_date,
65-
days_seen_bits,
66-
days_active_bits,
67-
{% if app_name == "firefox_desktop" %}
68-
days_desktop_active_bits,
69-
{% endif %}
70-
days_created_profile_bits
71-
),
96+
client_id,
97+
sample_id,
98+
first_run_date,
99+
durations,
100+
days_seen_session_start_bits,
101+
days_seen_session_end_bits,
102+
normalized_channel,
103+
normalized_os,
104+
normalized_os_version,
105+
android_sdk_version,
106+
locale,
107+
city,
108+
country,
109+
isp,
110+
app_build,
111+
app_channel,
112+
app_display_version,
113+
architecture,
114+
device_manufacturer,
115+
device_model,
116+
telemetry_sdk_build,
117+
first_seen_date,
118+
is_new_profile,
119+
distribution_id,
120+
geo_subdivision,
121+
profile_group_id,
122+
install_source,
123+
windows_build_number,
124+
browser_engagement_uri_count,
125+
browser_engagement_active_ticks,
126+
legacy_telemetry_client_id,
127+
is_default_browser,
72128
FROM
73129
`{{ last_seen_table }}`
74130
WHERE

0 commit comments

Comments
 (0)