-
Notifications
You must be signed in to change notification settings - Fork 104
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
DENG-1705 - Add startup_profile_selection_reason from first ping to clients_daily, clients_first_seen_v2 and downstream #4482
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
721faff
DENG-1705 - Add startup_profile_selection_reason to clients_first_seen
ANich b5522c7
Add startup_profile_selection_reason_first_ping_only
ANich e26d8eb
Query typo
ANich 6b0a3f6
Update test schema
ANich 3cb4f48
Update sql/moz-fx-data-shared-prod/telemetry_derived/clients_first_se…
ANich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you do it this way to make it clear that this is a zero-activity-days bit pattern? Over e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, for comprehension purposes |
||
) 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 | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 There should be very very few cases where we receive MULTIPLE pings with subsession_counter = 1 from a single client_id. But in those cases, if maybe one of them has the startup_profile_selection_reason we are looking for (while maybe 2+ others don't), we will miss it.
These would be weird clients that we possibly would want to ignore for other reasons, so I'm not advocating for any change here, just noting what the behavior will be for the record.