xtrntr
09/21/2021, 6:05 AMdimTable
but not factTable
to filter in the WHERE clause?
https://docs.google.com/document/d/1InWmxbRqwcqIakzvoEWHLxtX4XR9H5L01256EbAUHV8/edit#
Table factTable:
string uuid
int metric
timestamp event_time
string status
Table dimTable:
string uuid
string name
string country
SELECT
f.uuid,
d.name,
d.country,
abs(sum(m.metric)) as sum_metric
FROM
factTable f join dimTable d on f.uuid = d.uuid
WHERE
d.country in ('USA')
GROUP BY
1,
2,
3
ORDER BY
2
xtrntr
09/22/2021, 2:45 AMMayank
Kishore G
Kishore G
xtrntr
09/22/2021, 6:11 AMSELECT
f.uuid,
lookUp('dimTable', 'name', 'uuid', f.uuid) as name,
lookUp('dimTable', 'country', 'uuid', f.uuid) as country,
abs(sum(m.metric)) as sum_metric
FROM
factTable f
WHERE
...
GROUP BY
1,
2,
3
ORDER BY
Kishore G