Skip to content

Commit

Permalink
DENG-1705 - Add startup_profile_selection_reason to clients_first_seen
Browse files Browse the repository at this point in the history
  • Loading branch information
ANich committed Nov 9, 2023
1 parent f55f6b6 commit e3ee63d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ WITH clients_first_seen_28_days_ago AS (
attribution_experiment,
attribution_dltoken,
attribution_dlsource,
-- startup_profile_selection_reason, when startup_profile_selection_reason is available
startup_profile_selection_reason,
first_seen_date,
FROM
telemetry_derived.clients_first_seen_v2
Expand All @@ -38,24 +38,20 @@ clients_first_seen_28_days_ago_with_days_seen AS (
AND cls.submission_date = @submission_date
)
SELECT
client_id,
sample_id,
first_seen_date,
@submission_date AS submission_date,
country_code,
channel,
build_id,
os,
os_version,
distribution_id,
attribution_source,
attribution_ua,
attribution_medium,
attribution_campaign,
attribution_content,
attribution_experiment,
attribution_dltoken,
attribution_dlsource,
* REPLACE (
COALESCE(
days_seen_bits,
mozfun.bits28.from_string('0000000000000000000000000000')
) AS days_seen_bits,
COALESCE(
days_visited_1_uri_bits,
mozfun.bits28.from_string('0000000000000000000000000000')
) AS days_visited_1_uri_bits,
COALESCE(
days_interacted_bits,
mozfun.bits28.from_string('0000000000000000000000000000')
) AS days_interacted_bits
),
COALESCE(
BIT_COUNT(mozfun.bits28.from_string('1111111000000000000000000000') & days_seen_bits) >= 5,
FALSE
Expand Down Expand Up @@ -84,17 +80,6 @@ SELECT
) > 0,
FALSE
) AS qualified_week4,
COALESCE(
days_seen_bits,
mozfun.bits28.from_string('0000000000000000000000000000')
) AS days_seen_bits,
COALESCE(
days_visited_1_uri_bits,
mozfun.bits28.from_string('0000000000000000000000000000')
) AS days_visited_1_uri_bits,
COALESCE(
days_interacted_bits,
mozfun.bits28.from_string('0000000000000000000000000000')
) AS days_interacted_bits,
@submission_date AS submission_date,
FROM
clients_first_seen_28_days_ago_with_days_seen
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ fields:
- name: days_interacted_bits
type: INTEGER
mode: NULLABLE
- name: startup_profile_selection_reason
type: STRING
mode: NULLABLE
description: Client's first startup_profile_selection reason.
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ main_ping AS (
ARRAY_AGG(normalized_os_version RESPECT NULLS ORDER BY submission_date)[
SAFE_OFFSET(0)
] AS normalized_os_version,
CAST(
NULL AS STRING
) AS startup_profile_selection_reason, -- main_v5:payload.processes.parent.scalars.startup_profile_selection_reason
ARRAY_AGG(startup_profile_selection_reason_first RESPECT NULLS ORDER BY submission_date)[
SAFE_OFFSET(0)
] AS startup_profile_selection_reason,
ARRAY_AGG(attribution.dltoken RESPECT NULLS ORDER BY submission_date)[
SAFE_OFFSET(0)
] AS attribution_dltoken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,9 @@
{
"type": "STRING",
"name": "normalized_os_version"
},
{
"type": "STRING",
"name": "startup_profile_selection_reason_first"
}
]

0 comments on commit e3ee63d

Please sign in to comment.