add tx body model to gold

This commit is contained in:
Eric Laurello 2023-06-26 12:14:11 -04:00
parent 77e0902441
commit 70b9ad2f04
3 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,14 @@
{{ config(
materialized = 'view'
) }}
SELECT
block_id,
block_timestamp,
tx_id,
tx_succeeded,
msg_group AS msg_index,
msg_type,
msg
FROM
{{ ref('silver__tx_body_msgs') }}

View File

@ -0,0 +1,33 @@
version: 2
models:
- name: core__fact_tx_body_msgs
description: Records of all messages within the transaction body from transactions that have occurred on Osmosis, dating back to the genesis block
columns:
- name: BLOCK_ID
description: "{{ doc('block_id') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: BLOCK_TIMESTAMP
description: "{{ doc('block_timestamp') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: TX_ID
description: "{{ doc('tx_id') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: TX_SUCCEEDED
description: "{{ doc('tx_succeeded') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: MSG_INDEX
description: "{{ doc('msg_index') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: MSG_TYPE
description: "{{ doc('msg_type') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: MSG
description: "The underlying json from the message or event within the transactions"
tests:
- dbt_expectations.expect_column_to_exist

View File

@ -2,7 +2,7 @@
materialized = 'incremental',
unique_key = "_unique_key",
incremental_strategy = 'merge',
cluster_by = ['_inserted_timestamp::DATE']
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
) }}
WITH b AS (