Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/data/gleanSql.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
export const getGleanQuery = (columnName, table) => `
-- Auto-generated by the Glean Dictionary.
-- Auto-generated by Glean Dictionary.
-- https://docs.telemetry.mozilla.org/cookbooks/accessing_glean_data.html#accessing-glean-data-in-bigquery

SELECT
${columnName}
/* Uncomment this and the next block to segment by locale
,client_info.locale,
COUNT(*) AS count
*/
FROM
${table} AS m
WHERE
-- Pick yesterday's data from stable/historical tables.
-- https://docs.telemetry.mozilla.org/cookbooks/bigquery/querying.html#table-layout-and-naming
DATE(submission_timestamp) = DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
AND ${columnName} IS NOT NULL
/* Uncomment this and the previous commented block to segment by locale
GROUP BY
${columnName},
client_info.locale
ORDER BY COUNT DESC
*/
-- IMPORTANT: Remove the limit clause when the query is ready.
LIMIT 10`;

Expand Down