diff --git a/src/data/gleanSql.js b/src/data/gleanSql.js index 99a4f3766..f9b24c4be 100644 --- a/src/data/gleanSql.js +++ b/src/data/gleanSql.js @@ -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`;