Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions definitions/output/crawl/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ ORDER BY cnt_pages DESC
HAVING cnt_pages > 200
`)

assert('pages_per_client')
.tags(['crawl_complete'])
.query(ctx => `
SELECT
client,
COUNT(DISTINCT page) AS cnt_pages
FROM ${ctx.ref('crawl_staging', 'pages')}
WHERE
date = '${constants.currentMonth}'
GROUP BY
client
HAVING cnt_pages < 20000000
`)

publish('pages', {
type: 'incremental',
protected: true,
Expand Down
10 changes: 4 additions & 6 deletions definitions/output/reports/reports_html_elements_popularity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const pastMonth = constants.fnPastMonth(constants.currentMonth)

publish('html_elements_popularity', {
schema: 'reports',
type: 'incremental',
Expand All @@ -18,7 +16,7 @@ try {
''';

DELETE FROM ${ctx.self()}
WHERE date = '${pastMonth}';
WHERE date = '${constants.currentMonth}';
`).query(ctx => `
WITH pages_data AS (
SELECT
Expand All @@ -29,7 +27,7 @@ WITH pages_data AS (
custom_metrics.element_count
FROM ${ctx.ref('crawl', 'pages')}
WHERE
date = '${pastMonth}' ${constants.devRankFilter}
date = '${constants.currentMonth}' ${constants.devRankFilter}
),

totals AS (
Expand Down Expand Up @@ -69,9 +67,9 @@ SELECT
"destination": "cloud_storage",
"config": {
"bucket": "${constants.bucket}",
"name": "${constants.storagePath}${pastMonth.replaceAll('-', '_')}/htmlElementPopularity.json"
"name": "${constants.storagePath}${constants.currentMonth.replaceAll('-', '_')}/htmlElementPopularity.json"
},
"query": "SELECT * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
"query": "SELECT * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${constants.currentMonth}'"
}'''
);
`)