Skip to content

Commit

Permalink
no drop table
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ostapenko committed Oct 8, 2024
1 parent 65f098c commit 826c26b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions definitions/output/all/reprocess_pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ operate(`all_pages_stable_pre`).tags(
).queries(`
CREATE SCHEMA IF NOT EXISTS all_dev;
DROP TABLE IF EXISTS \`all_dev.pages_stable\`;
-- DROP TABLE IF EXISTS \`all_dev.pages_stable\`;
CREATE TABLE \`all_dev.pages_stable\`
CREATE TABLE IF NOT EXISTS \`all_dev.pages_stable\`
(
date DATE NOT NULL OPTIONS(description="YYYY-MM-DD format of the HTTP Archive monthly crawl"),
client STRING NOT NULL OPTIONS(description="Test environment: desktop or mobile"),
Expand Down Expand Up @@ -80,6 +80,9 @@ iterations.forEach((iteration, i) => {
]).dependencies([
i === 0 ? "all_pages_stable_pre" : `all_pages_stable_update ${iterations[i - 1].month} ${iterations[i - 1].client}`
]).queries(ctx => `
DELETE FROM \`all_dev.pages_stable\`
WHERE date = "${iteration.month}";
INSERT INTO \`all_dev.pages_stable\`
SELECT
date,
Expand Down
7 changes: 5 additions & 2 deletions definitions/output/all/reprocess_requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ operate(`all_requests_stable_pre`).tags(
).queries(`
CREATE SCHEMA IF NOT EXISTS all_dev;
DROP TABLE IF EXISTS \`all_dev.requests_stable\`;
-- DROP TABLE IF EXISTS \`all_dev.requests_stable\`;
CREATE TABLE \`all_dev.requests_stable\`
CREATE TABLE IF NOT EXISTS \`all_dev.requests_stable\`
(
date DATE NOT NULL OPTIONS(description="YYYY-MM-DD format of the HTTP Archive monthly crawl"),
client STRING NOT NULL OPTIONS(description="Test environment: desktop or mobile"),
Expand Down Expand Up @@ -57,6 +57,9 @@ iterations.forEach((iteration, i) => {
).dependencies([
i === 0 ? "all_requests_stable_pre" : `all_requests_stable ${iterations[i - 1].month} ${iterations[i - 1].client}`
]).queries(ctx => `
DELETE FROM \`all_dev.requests_stable\`
WHERE date = "${iteration.month}";
CREATE TEMP FUNCTION PRUNE_HEADERS(
jsonObject JSON
) RETURNS JSON
Expand Down
4 changes: 2 additions & 2 deletions workflow_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ defaultAssertionDataset: dataform_assertions

vars:
placeholder: value # keeping it to avoid 'empty vars' error
env_name: dev # MUST be commented in main branch, enables processing sampled data
today: 2024-09-20 # MUST be commented in main branch, allows processing historical data
# env_name: dev # MUST be commented in main branch, enables processing sampled data
# today: 2024-09-20 # MUST be commented in main branch, allows processing historical data

0 comments on commit 826c26b

Please sign in to comment.