From 3fb337d0052e031a06fc282ade3085c1aee630c6 Mon Sep 17 00:00:00 2001 From: David Fox Date: Sun, 15 Aug 2021 14:54:28 -0500 Subject: [PATCH] Removed duplicate metric --- sql/2021/mobile-web/client_hints.sql | 2 +- sql/2021/mobile-web/popular_input_types.sql | 31 --------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 sql/2021/mobile-web/popular_input_types.sql diff --git a/sql/2021/mobile-web/client_hints.sql b/sql/2021/mobile-web/client_hints.sql index 742ba405f6a..7fb6b492939 100644 --- a/sql/2021/mobile-web/client_hints.sql +++ b/sql/2021/mobile-web/client_hints.sql @@ -1,5 +1,5 @@ # standardSQL -# Usage of client hint diretivese headers +# Usage of client hint directives CREATE TEMPORARY FUNCTION getClientHints(payload STRING) RETURNS ARRAY LANGUAGE js AS """ try { diff --git a/sql/2021/mobile-web/popular_input_types.sql b/sql/2021/mobile-web/popular_input_types.sql deleted file mode 100644 index ed7f14bf833..00000000000 --- a/sql/2021/mobile-web/popular_input_types.sql +++ /dev/null @@ -1,31 +0,0 @@ -#standardSQL -# Popular input types -CREATE TEMPORARY FUNCTION getInputTypes(payload STRING) -RETURNS ARRAY LANGUAGE js AS ''' - try { - const almanac = JSON.parse(payload); - return almanac.input_elements && almanac.input_elements.map(function(node) { - return node.type.toLowerCase(); - }); - } catch (e) { - return []; - } -'''; - -SELECT - total_sites AS total_sites, - SUM(COUNT(DISTINCT url)) OVER (PARTITION BY client) AS total_sites_with_inputs, - - input_type, - COUNT(0) AS total_sites_using, - COUNT(0) / SUM(COUNT(DISTINCT url)) OVER (PARTITION BY client) AS pct_input_sites_using, - COUNT(0) / total_sites AS pct_sites -FROM - `httparchive.pages.2021_07_01_mobile`, - (SELECT COUNT(0) AS total_sites FROM `httparchive.summary_pages.2021_07_01_mobile`), - UNNEST(getInputTypes(JSON_EXTRACT_SCALAR(payload, '$._almanac'))) as input_type -GROUP BY - input_type, - total_sites -ORDER BY - occurence DESC