Database Reference
In-Depth Information
'system',
'com.googlecode.bigquery_e2e.sensors.client',
'com.redbend.vdmc')
AND running.importance.level >=100
AND running.importance.level < 400
GROUP BY 1
ORDER BY 2 DESC''',
'top_apps'
),
max_age='12h'
),
BackgroundQuery(
_dashboard_query_job(
'''SELECT ZipsInDay, COUNT(1) FROM (
SELECT D, id, COUNT(zip) ZipsInDay FROM (
SELECT
DATE(ts) D, id, location.zip [zip]
FROM TABLE_DATE_RANGE(logs.device_,
DATE_ADD(CURRENT_TIMESTAMP(),
-6, 'DAY'),
CURRENT_TIMESTAMP())
GROUP EACH BY 1, 2, 3)
GROUP EACH BY 1, 2)
GROUP BY 1 ORDER BY 1''',
'zips_in_day'
),
max_age='12h'
),
]
This simple application has only a couple of tables that need to be updated,
so you could just initiate the query jobs from the scheduled task. However,
if there are a large number of tables and especially if you want to monitor
the outcome of the operation, it is not practical to issue them sequentially
in a single scheduled task handler. The sample code is designed to scale
up by leveraging the Task Queue framework available in App Engine
( https://developers.google.com/appengine/docs/python/
taskqueue/ ). The scheduled task adds tasks to a queue rather than
Search WWH ::




Custom Search