fix prod run error

This commit is contained in:
Chuxin Huang 2022-03-07 21:06:19 +11:00
parent b50d6eb591
commit 2ac39ff63f
3 changed files with 1 additions and 47 deletions

View File

@ -1,7 +1,7 @@
{{
config(
materialized = 'incremental',
unique_key = 'tx_hash',
unique_key = 'tx_id',
tags = ['core'],
cluster_by = ['block_timestamp']
)

View File

@ -1,28 +0,0 @@
{{ config(materialized='table', tags=['metrics']) }}
-- WIP - example of creating metrics table/construct
SELECT
date_trunc('day', block_timestamp) as metric_date,
'daily' as metric_period,
count(distinct miner) as miner_count
FROM {{ ref("blocks") }}
GROUP BY 1
UNION ALL
SELECT
date_trunc('hour', block_timestamp) as metric_date,
'hourly' as metric_period,
count(distinct miner) as miner_count
FROM {{ ref("blocks") }}
GROUP BY 1
UNION ALL
SELECT
date_trunc('minute', block_timestamp) as metric_date,
'minute' as metric_period,
count(distinct miner) as miner_count
FROM {{ ref("blocks") }}
GROUP BY 1

View File

@ -1,18 +0,0 @@
version: 2
models:
- name: metric_miner_count
description: "The distinct number of miners within a given period"
columns:
- name: metric_date
description: The date the metric occurred
tests:
- not_null
- name: metric_period
description: i.e. Hourly, Daily, etc.
tests:
- not_null
- name: miner_count
description: The distinct count of miners active in that period.
tests:
- not_null