mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 16:30:12 +02: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:
parent
8a921f08ed
commit
33eb5f1c87
14 changed files with 160 additions and 171 deletions
|
@ -14,15 +14,16 @@
|
|||
|
||||
-- Query to fetch AppEngine request logs for the report month.
|
||||
|
||||
-- START_OF_MONTH and END_OF_MONTH should be in YYYY-MM-01 format.
|
||||
-- START_OF_MONTH and END_OF_MONTH should be in YYYYMM01 format.
|
||||
|
||||
SELECT
|
||||
protoPayload.resource AS requestPath,
|
||||
protoPayload.line.logMessage AS logMessage,
|
||||
ARRAY(
|
||||
SELECT
|
||||
logMessage
|
||||
FROM
|
||||
UNNEST(protoPayload.line)) AS logMessage
|
||||
FROM
|
||||
TABLE_DATE_RANGE_STRICT(
|
||||
[%APPENGINE_LOGS_DATA_SET%.%REQUEST_TABLE%],
|
||||
TIMESTAMP('%START_OF_MONTH%'),
|
||||
-- End timestamp is inclusive, so subtract 1 day from the
|
||||
-- timestamp representing the start of the next month.
|
||||
DATE_ADD(TIMESTAMP('%END_OF_MONTH%'), -1, 'DAY'))
|
||||
`%PROJECT_ID%.%APPENGINE_LOGS_DATA_SET%.%REQUEST_TABLE%*`
|
||||
WHERE
|
||||
_TABLE_SUFFIX BETWEEN '%START_OF_MONTH%' AND '%END_OF_MONTH%'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue