mirror of
https://github.com/google/nomulus
synced 2026-02-08 05:50:24 +00:00
Upgrade activity reporting queries to StandardSQL
This also brings the SQL template parameters in-line with the anticipated Bigquery dataset format, and switches from DateTime to the more appropriate LocalDate (since we only need monthly granularity). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=162747692
This commit is contained in:
@@ -18,16 +18,15 @@
|
||||
-- counts the number of hits via both endpoints (port 43 and the web).
|
||||
|
||||
SELECT
|
||||
-- Whois applies to all TLDs, hence the 'null' magic value.
|
||||
STRING(NULL) AS tld,
|
||||
-- Whois queries over port 43 get forwarded by the proxy to /_dr/whois,
|
||||
-- while web queries come in via /whois/<params>.
|
||||
CASE
|
||||
WHEN requestPath = '/_dr/whois' THEN 'whois-43-queries'
|
||||
WHEN LEFT(requestPath, 7) = '/whois/' THEN 'web-whois-queries'
|
||||
WHEN SUBSTR(requestPath, 0, 7) = '/whois/' THEN 'web-whois-queries'
|
||||
END AS metricName,
|
||||
INTEGER(COUNT(requestPath)) AS count,
|
||||
COUNT(requestPath) AS count
|
||||
FROM
|
||||
[%MONTHLY_LOGS_DATA_SET%.%MONTHLY_LOGS_TABLE%]
|
||||
GROUP BY metricName
|
||||
HAVING metricName IS NOT NULL
|
||||
`%PROJECT_ID%.%ICANN_REPORTING_DATA_SET%.%MONTHLY_LOGS_TABLE%`
|
||||
GROUP BY
|
||||
metricName
|
||||
HAVING
|
||||
metricName IS NOT NULL
|
||||
|
||||
Reference in New Issue
Block a user