@@ -19,7 +19,7 @@ if (iterations.length === 1) {
1919 protected : true ,
2020 bigquery : sql . type === 'histogram' ? { partitionBy : 'date' , clusterBy : [ 'client' ] } : { } ,
2121 schema : 'reports' ,
22- tags : [ 'crawl_complete' , 'http_reports' ]
22+ // tags: ['crawl_complete', 'http_reports']
2323 } ) . preOps ( ctx => `
2424--DELETE FROM ${ ctx . self ( ) }
2525--WHERE date = '${ params . date } ';
@@ -45,21 +45,22 @@ SELECT
4545 metrics . forEach ( metric => {
4646 metric . SQL . forEach ( sql => {
4747 operate ( metric . id + '_' + sql . type + '_' + params . date , {
48- tags : [ 'crawl_complete' ]
48+ // tags: ['crawl_complete']
4949 } ) . queries ( ctx => `
5050DELETE FROM reports.${ metric . id } _${ sql . type }
5151WHERE date = '${ params . date } ';
5252
5353INSERT INTO reports.${ metric . id } _${ sql . type } ` + sql . query ( ctx , params )
5454 ) . postOps ( ctx => `
55- SELECT
55+ SELECT
5656 reports.run_export_job(
5757 JSON '''{
58- "dataform_trigger": "report_complete",
59- "date": "${ params . date } ",
60- "name": "${ metric . id } ",
61- "type": "${ sql . type } ",
62- "environment": "${ constants . environment } "
58+ "destination": "cloud_storage",
59+ "config": {
60+ "bucket": "httparchive",
61+ "name": "reports/${ constants . environment } /${ metric . id } _${ sql . type } _${ params . date } .json"
62+ },
63+ "query": "SELECT FORMAT_DATE('%Y_%m_%d', date) AS date, * EXCEPT(date) FROM ${ ctx . self ( ) } "
6364 }'''
6465 );
6566 ` )
0 commit comments