Telemetry/LongitudinalExamples: Difference between revisions
Jump to navigation
Jump to search
Gfritzsche (talk | contribs) (adding doc links for array and map functions) |
(added some blocklist examples) |
||
Line 23: | Line 23: | ||
Links: | Links: | ||
* [https://prestodb.io/docs/current/functions/map.html Documentation on map functions] | * [https://prestodb.io/docs/current/functions/map.html Documentation on map functions] | ||
=== Examples === | |||
* Blocklist URLs (extensions.blocklist.url): | |||
SELECT bl, COUNT(bl) | |||
FROM | |||
(SELECT client_id, | |||
element_at(settings, 1).user_prefs['extensions.blocklist.url'] AS bl | |||
FROM longitudinal_v20160229) | |||
GROUP BY bl | |||
* Blocklist enabled/disabled (extensions.blocklist.enabled) count: | |||
SELECT bl, COUNT(bl) | |||
FROM | |||
(SELECT client_id, | |||
element_at(settings, 1).blocklist_enabled AS bl | |||
FROM longitudinal_v20160229) | |||
GROUP BY bl |
Revision as of 16:12, 7 March 2016
Note: There is good background in the example notebook for the longitudinal data set.
Get an overview of the longitudinal data table:
describe longitudinal_v20160229
That table has a row for each client, with columns for the different parts of the ping. Some properties are directly available to query on:
SELECT count(*) AS count FROM longitudinal_v20160229 WHERE os = 'Linux'
Arrays
Other properties are arrays, which contain one entry for each submission from that client (newest first):
SELECT element_at(reason, 1) AS last_reason FROM longitudinal_v20160229 WHERE os = 'Linux'
Links:
Maps
Links:
Examples
- Blocklist URLs (extensions.blocklist.url):
SELECT bl, COUNT(bl) FROM (SELECT client_id, element_at(settings, 1).user_prefs['extensions.blocklist.url'] AS bl FROM longitudinal_v20160229) GROUP BY bl
- Blocklist enabled/disabled (extensions.blocklist.enabled) count:
SELECT bl, COUNT(bl) FROM (SELECT client_id, element_at(settings, 1).blocklist_enabled AS bl FROM longitudinal_v20160229) GROUP BY bl