From 3c558a64e5a4c04d1f0c9232f19988e90fa10275 Mon Sep 17 00:00:00 2001 From: cavis Date: Mon, 4 Dec 2023 16:26:38 -0700 Subject: [PATCH 1/4] Change date format --- src/query-jobs/boostr_impressions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query-jobs/boostr_impressions.js b/src/query-jobs/boostr_impressions.js index 32e48ac..cc1184e 100644 --- a/src/query-jobs/boostr_impressions.js +++ b/src/query-jobs/boostr_impressions.js @@ -6,7 +6,7 @@ module.exports = async function main(config) { const query = ` SELECT - timestamp_trunc(timestamp, day) AS Date, + FORMAT_TIMESTAMP("%m/%d/%Y", timestamp) as Date, external_id AS \`Ad Server Line\`, count(*) AS Impressions FROM ${process.env.BIGQUERY_DATASET}.dt_impressions From d8aa212e1ddc77bd41068fa29331ff498f68c4e5 Mon Sep 17 00:00:00 2001 From: cavis Date: Mon, 4 Dec 2023 16:26:53 -0700 Subject: [PATCH 2/4] Option to use plain dates in format --- src/make_copies.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/make_copies.js b/src/make_copies.js index 303286d..55bbb9d 100644 --- a/src/make_copies.js +++ b/src/make_copies.js @@ -65,10 +65,18 @@ module.exports = async function main( /%RANGE_START_ISO/g, config.inclusiveRangeStart.toISOString() ) + .replace( + /%RANGE_START_DATE_ISO/g, + config.inclusiveRangeStart.toISOString().split("T")[0] + ) .replace( /%RANGE_END_ISO/g, config.exclusiveRangeEnd.toISOString() ) + .replace( + /%RANGE_END_DATE_ISO/g, + config.exclusiveRangeEnd.toISOString().split("T")[0] + ) .replace(/%TYPE/g, extractionType) .replace(/%REQUEST_ID/g, config.requestId) .replace(/%REQUEST_TIME/g, +config.requestTime) From ab554020baedaa0c0fce12716614fc6ebda028a7 Mon Sep 17 00:00:00 2001 From: cavis Date: Tue, 5 Dec 2023 09:21:48 -0700 Subject: [PATCH 3/4] Capitalize --- src/query-jobs/boostr_impressions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query-jobs/boostr_impressions.js b/src/query-jobs/boostr_impressions.js index cc1184e..326894b 100644 --- a/src/query-jobs/boostr_impressions.js +++ b/src/query-jobs/boostr_impressions.js @@ -6,7 +6,7 @@ module.exports = async function main(config) { const query = ` SELECT - FORMAT_TIMESTAMP("%m/%d/%Y", timestamp) as Date, + FORMAT_TIMESTAMP("%m/%d/%Y", timestamp) AS Date, external_id AS \`Ad Server Line\`, count(*) AS Impressions FROM ${process.env.BIGQUERY_DATASET}.dt_impressions From 7fba556ecff6cb33a2c5ec042ac2734930557092 Mon Sep 17 00:00:00 2001 From: cavis Date: Tue, 5 Dec 2023 09:23:11 -0700 Subject: [PATCH 4/4] Update docs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ee1e167..68edda6 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,8 @@ For example, if it is currently `2022-05-05T12:34:56Z`, the range will be `["202 # - DestinationFormat allows for custom-named copies using directives: # - %RANGE_START_ISO - e.g., 2022-05-04T00:00:00.000Z # - %RANGE_END_ISO - e.g., 2022-05-05T00:00:00.000Z + # - %RANGE_START_DATE_ISO - e.g., 2022-05-04 + # - %RANGE_END_DATE_ISO - e.g., 2022-05-05 # - %TYPE - e.g., downloads, episode_metadata, etc # - %REQUEST_ID - A unique identifier for the Lambda invocation # - %REQUEST_TIME - A unix timestamp in milliseconds