-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
CMS 2024 queries #3731
base: main
Are you sure you want to change the base?
CMS 2024 queries #3731
Conversation
This should be using This will give access to secondary resources and also be more future-proof. |
Thanks! I'm currently adjusting the queries, the results remain very stable and there are almost no changes. |
Is it worth adding ?
|
Fixing linter issues.
Fixing linting.
Fixing the linter errors.
Linter errors
Fixing linter errors.
Fixing linter errors.
removing white space.
Fixing linting issues.
Fixing linting issues.
Fixing linting issues.
@@ -0,0 +1,68 @@ | |||
#standardSQL |
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.
In testing this I'm getting "There is no data to display." as an error.
I don't think it was updated correctly. Maybe the dateformat is wrong?
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.
I got better results with this:
#standardSQL
# CMS popularity per geo
WITH geo_summary AS (
SELECT
`chrome-ux-report`.experimental.GET_COUNTRY(country_code) AS geo,
IF(device = 'desktop', 'desktop', 'mobile') AS client,
origin,
COUNT(DISTINCT origin) OVER (PARTITION BY country_code, IF(device = 'desktop', 'desktop', 'mobile')) AS total
FROM
`chrome-ux-report.materialized.country_summary`
WHERE
yyyymm = 202406
)
SELECT
client,
geo,
cms,
COUNT(0) AS pages,
ANY_VALUE(total) AS total,
COUNT(DISTINCT url) / ANY_VALUE(total) AS pct
FROM (
-- Step 1: Extract distinct URLs from geo_summary (grouped by country and device).
SELECT DISTINCT
geo,
client,
CONCAT(origin, '/') AS url,
total
FROM
geo_summary
) JOIN (
-- Step 2: Join with the CMS data from httparchive.all.pages for the top CMS per country.
SELECT DISTINCT
client,
technologies.technology AS cms,
page AS url
FROM
`httparchive.all.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS categories
WHERE
categories = 'CMS' AND
technologies.technology != '' AND
date = '2024-06-01' AND
is_root_page
) USING (client, url)
GROUP BY
client,
geo,
cms
HAVING
pages > 1000 -- Include only CMSes with more than 1000 pages in a country.
ORDER BY
pages DESC
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.
I do not get this error. Can you confirm it is still an error please?
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.
Overall LGTM but with one suggestion.
Let me know when good to merge
Co-authored-by: Barry Pollard <[email protected]>
Co-authored-by: Barry Pollard <[email protected]>
From my end this is ready to be merged. @sirjonathan can you confirm? |
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.
LGTM.. Let me know if good to merge.
Makes progress on #3608