Created
December 16, 2014 20:29
-
-
Save Ironholds/428014d22edb7969ff5c to your computer and use it in GitHub Desktop.
App UUID query
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
DROP VIEW IF EXISTS app_uuid_view; | |
CREATE VIEW app_uuid_view AS | |
SELECT | |
CASE WHEN user_agent LIKE('%iPhone%') THEN 'iOS' | |
ELSE 'Android' END AS platform, | |
parse_url(concat('http://bla.org/woo/', uri_query), 'QUERY', 'appInstallID') AS uuid | |
FROM wmf_raw.webrequest | |
WHERE uri_query LIKE('%sections=0%') | |
AND uri_query LIKE('%action=mobileview%') | |
AND uri_query LIKE('%appInstallID%') | |
AND webrequest_source IN ('mobile','text') | |
AND user_agent LIKE('WikipediaApp%'); | |
SELECT platform, COUNT(DISTINCT(uuid)) | |
FROM app_uuid_view | |
GROUP BY platform; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment