Skip to content

Commit f0d7fb0

Browse files
committed
ranks and geos
1 parent 8074cbd commit f0d7fb0

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const pastMonth = constants.fnPastMonth(constants.currentMonth)
2+
3+
publish('tech_report_geos', {
4+
schema: 'reports',
5+
type: 'table',
6+
tags: ['tech_report']
7+
}).query(ctx => `
8+
SELECT
9+
geo,
10+
adoption AS origins
11+
FROM ${ctx.ref('reports', 'tech_report_adoption')}
12+
WHERE
13+
date = '${pastMonth}'
14+
AND rank = 'ALL'
15+
AND technology = 'ALL'
16+
AND version = 'ALL'
17+
${constants.devRankFilter}
18+
`).postOps(ctx => `
19+
SELECT
20+
reports.run_export_job(
21+
JSON '''{
22+
"destination": "firestore",
23+
"config": {
24+
"database": "tech-report-api-${constants.environment}",
25+
"collection": "geos",
26+
"type": "dict"
27+
},
28+
"query": "SELECT * FROM ${ctx.self()}"
29+
}'''
30+
);
31+
`)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const pastMonth = constants.fnPastMonth(constants.currentMonth)
2+
3+
publish('tech_report_ranks', {
4+
schema: 'reports',
5+
type: 'table',
6+
tags: ['tech_report']
7+
}).query(ctx => `
8+
SELECT
9+
rank,
10+
adoption AS origins
11+
FROM ${ctx.ref('reports', 'tech_report_adoption')}
12+
WHERE
13+
date = '${pastMonth}'
14+
AND geo = 'ALL'
15+
AND technology = 'ALL'
16+
AND version = 'ALL'
17+
${constants.devRankFilter}
18+
`).postOps(ctx => `
19+
SELECT
20+
reports.run_export_job(
21+
JSON '''{
22+
"destination": "firestore",
23+
"config": {
24+
"database": "tech-report-api-${constants.environment}",
25+
"collection": "ranks",
26+
"type": "dict"
27+
},
28+
"query": "SELECT * FROM ${ctx.self()}"
29+
}'''
30+
);
31+
`)

0 commit comments

Comments
 (0)