-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
791 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
node_modules/ | ||
.df-credentials.json | ||
tf/.terraform/ | ||
tf/temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,54 @@ | ||
const two_months_ago = constants.fn_past_month(constants.fn_past_month(constants.current_month)); | ||
const date = constants.current_month; | ||
|
||
operate("test_env", { | ||
hasOutput: true, | ||
disabled: true // MUST NOT be commented in main branch | ||
}).queries(ctx => ` | ||
CREATE OR REPLACE TABLE ${ctx.ref("all", "pages")} AS | ||
SELECT * | ||
FROM httparchive.all.pages ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${two_months_ago}'; | ||
var resources_list = [{ | ||
datasetId: "all", | ||
tableId: "pages" | ||
}, | ||
{ | ||
datasetId: "all", | ||
tableId: "requests" | ||
}, | ||
//{datasetId: "all", tableId: "parsed_css"}, | ||
//{datasetId: "core_web_vitals", tableId: "technologies"}, | ||
]; | ||
|
||
resources_list.forEach(resource => { | ||
operate( | ||
`test_table ${resource.datasetId}_${resource.tableId}`, { | ||
hasOutput: true | ||
} | ||
).queries(` | ||
CREATE SCHEMA IF NOT EXISTS ${resource.datasetId}_dev; | ||
CREATE OR REPLACE TABLE ${ctx.ref("all", "requests")} AS | ||
DROP TABLE IF EXISTS ${resource.datasetId}_dev.dev_${resource.tableId}; | ||
CREATE TABLE IF NOT EXISTS ${resource.datasetId}_dev.dev_${resource.tableId} AS | ||
SELECT * | ||
FROM httparchive.all.requests ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${two_months_ago}'; | ||
FROM \`${resource.datasetId}.${resource.tableId}\` ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${date}' | ||
`); | ||
}) | ||
|
||
operate("test_table blink_features_dev_dev_usage", { | ||
hasOutput: true, | ||
}).queries(` | ||
CREATE SCHEMA IF NOT EXISTS blink_features_dev; | ||
CREATE OR REPLACE TABLE ${ctx.ref("all", "parsed_css")} AS | ||
CREATE TABLE IF NOT EXISTS blink_features_dev.dev_usage AS | ||
SELECT * | ||
FROM httparchive.all.parsed_css ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${two_months_ago}'; | ||
FROM blink_features.usage ${constants.dev_TABLESAMPLE} | ||
WHERE yyyymmdd = '${date}'; | ||
`) | ||
|
||
operate("test_table blink_features_dev_dev_features", { | ||
hasOutput: true, | ||
}).queries(` | ||
CREATE SCHEMA IF NOT EXISTS blink_features_dev; | ||
DROP TABLE IF EXISTS blink_features_dev.dev_features; | ||
CREATE OR REPLACE TABLE ${ctx.ref("core_web_vitals", "technologies")} AS | ||
CREATE TABLE IF NOT EXISTS blink_features_dev.dev_features AS | ||
SELECT * | ||
FROM httparchive.core_web_vitals.technologies | ||
WHERE date = '${two_months_ago}' | ||
FROM blink_features.features ${constants.dev_TABLESAMPLE} | ||
WHERE yyyymmdd = DATE '${date}'; | ||
`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,45 @@ | ||
publish("pages", { | ||
type: "incremental", | ||
protected: true, | ||
schema: "all", | ||
bigquery: { | ||
partitionBy: "date", | ||
clusterBy: ["client", "is_root_page", "rank"], | ||
requirePartitionFilter: true | ||
}, | ||
tags: ["crawl_results_all"], | ||
type: "incremental", | ||
protected: true, | ||
schema: "all", | ||
bigquery: { | ||
partitionBy: "date", | ||
clusterBy: ["client", "is_root_page", "rank"], | ||
requirePartitionFilter: true | ||
}, | ||
tags: ["crawl_results_all"], | ||
}).preOps(ctx => ` | ||
DELETE FROM ${ctx.self()} | ||
WHERE date = '${constants.current_month}'; | ||
`).query(ctx => ` | ||
SELECT * | ||
FROM ${ctx.ref("crawl_staging", "pages")} ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${constants.current_month}' AND client = 'desktop' AND is_root_page = TRUE | ||
FROM ${ctx.ref("crawl_staging", "pages")} | ||
WHERE date = '${constants.current_month}' | ||
AND client = 'desktop' | ||
AND is_root_page = TRUE | ||
${constants.dev_rank_filter} | ||
`).postOps(ctx => ` | ||
INSERT INTO ${ctx.self()} | ||
SELECT * | ||
FROM ${ctx.ref("crawl_staging", "pages")} ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${constants.current_month}' AND client = 'desktop' AND is_root_page = FALSE; | ||
FROM ${ctx.ref("crawl_staging", "pages")} | ||
WHERE date = '${constants.current_month}' | ||
AND client = 'desktop' | ||
AND is_root_page = FALSE | ||
${constants.dev_rank_filter}; | ||
INSERT INTO ${ctx.self()} | ||
SELECT * | ||
FROM ${ctx.ref("crawl_staging", "pages")} ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${constants.current_month}' AND client = 'mobile' AND is_root_page = TRUE; | ||
WHERE date = '${constants.current_month}' | ||
AND client = 'mobile' | ||
AND is_root_page = TRUE | ||
${constants.dev_rank_filter}; | ||
INSERT INTO ${ctx.self()} | ||
SELECT * | ||
FROM ${ctx.ref("crawl_staging", "pages")} ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${constants.current_month}' AND client = 'mobile' AND is_root_page = FALSE | ||
FROM ${ctx.ref("crawl_staging", "pages")} | ||
WHERE date = '${constants.current_month}' | ||
AND client = 'mobile' | ||
AND is_root_page = FALSE | ||
${constants.dev_rank_filter}; | ||
`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
publish("parsed_css", { | ||
type: "incremental", | ||
protected: true, | ||
schema: "all", | ||
bigquery: { | ||
partitionBy: "date", | ||
clusterBy: ["client", "is_root_page", "rank", "page"], | ||
requirePartitionFilter: true | ||
}, | ||
tags: ["crawl_results_all"], | ||
type: "incremental", | ||
protected: true, | ||
schema: "all", | ||
bigquery: { | ||
partitionBy: "date", | ||
clusterBy: ["client", "is_root_page", "rank", "page"], | ||
requirePartitionFilter: true | ||
}, | ||
tags: ["crawl_results_all"], | ||
}).preOps(ctx => ` | ||
DELETE FROM ${ctx.self()} | ||
WHERE date = '${constants.current_month}'; | ||
`).query(ctx => ` | ||
SELECT * | ||
FROM ${ctx.ref("crawl_staging", "parsed_css")} ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${constants.current_month}' AND client = 'desktop' | ||
FROM ${ctx.ref("crawl_staging", "parsed_css")} | ||
WHERE date = '${constants.current_month}' | ||
AND client = 'desktop' | ||
${constants.dev_rank_filter} | ||
`).postOps(ctx => ` | ||
INSERT INTO ${ctx.self()} | ||
SELECT * | ||
FROM ${ctx.ref("crawl_staging", "parsed_css")} ${constants.dev_TABLESAMPLE} | ||
WHERE date = '${constants.current_month}' AND client = 'mobile' | ||
FROM ${ctx.ref("crawl_staging", "parsed_css")} | ||
WHERE date = '${constants.current_month}' | ||
AND client = 'mobile' | ||
${constants.dev_rank_filter}; | ||
`) |
Oops, something went wrong.