staking-pools: create dim table

This commit is contained in:
Eevui 2022-10-12 22:33:36 +08:00
parent 0011512dd8
commit f4c0bed2e8
2 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,12 @@
{{ config(
materialized = 'view',
secure = true
) }}
with staking_pools as (
select
*
from {{ ref('silver__staking_pools') }}
)
select * from staking_pools

View File

@ -0,0 +1,63 @@
version: 2
models:
- name: core__dim_staking_pools
description: |-
This table contains registered staking pools with NEAR.
columns:
- name: tx_hash
description: "{{ doc('tx_hash') }}"
tests:
- not_null
- unique
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: block_timestamp
description: "{{ doc('block_timestamp')}}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ
- name: owner
description: "{{ doc('staking_pool_owner')}}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: address
description: "{{ doc('staking_pool_address')}}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: reward_fee_fraction
description: "{{ doc('staking_pool_reward_fee_fraction')}}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- VARIANT
- OBJECT
- name: tx_type
description: "{{ doc('staking_pool_tx_type') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['Create', 'Update']