mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 11:26:52 +00:00
move sources to bronze
This commit is contained in:
parent
1ce6f7cf8f
commit
11676ce493
21
models/bronze/bronze__address_labels.sql
Normal file
21
models/bronze/bronze__address_labels.sql
Normal file
@ -0,0 +1,21 @@
|
||||
{{ config(
|
||||
materialized = 'view'
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
system_created_at,
|
||||
blockchain,
|
||||
address,
|
||||
creator,
|
||||
label_type,
|
||||
label_subtype,
|
||||
address_name,
|
||||
project_name,
|
||||
insert_date AS _load_timestamp
|
||||
FROM
|
||||
{{ source(
|
||||
'crosschain',
|
||||
'address_labels'
|
||||
) }}
|
||||
WHERE
|
||||
blockchain = 'near'
|
||||
46
models/bronze/bronze__dates.sql
Normal file
46
models/bronze/bronze__dates.sql
Normal file
@ -0,0 +1,46 @@
|
||||
{{ config(
|
||||
materialized = 'view'
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
date_day,
|
||||
prior_date_day,
|
||||
next_date_day,
|
||||
prior_year_date_day,
|
||||
prior_year_over_year_date_day,
|
||||
day_of_week,
|
||||
day_of_week_iso,
|
||||
day_of_week_name,
|
||||
day_of_week_name_short,
|
||||
day_of_month,
|
||||
day_of_year,
|
||||
week_start_date,
|
||||
week_end_date,
|
||||
prior_year_week_start_date,
|
||||
prior_year_week_end_date,
|
||||
week_of_year,
|
||||
iso_week_start_date,
|
||||
iso_week_end_date,
|
||||
prior_year_iso_week_start_date,
|
||||
prior_year_iso_week_end_date,
|
||||
iso_week_of_year,
|
||||
prior_year_week_of_year,
|
||||
prior_year_iso_week_of_year,
|
||||
month_of_year,
|
||||
month_name,
|
||||
month_name_short,
|
||||
month_start_date,
|
||||
month_end_date,
|
||||
prior_year_month_start_date,
|
||||
prior_year_month_end_date,
|
||||
quarter_of_year,
|
||||
quarter_start_date,
|
||||
quarter_end_date,
|
||||
year_number,
|
||||
year_start_date,
|
||||
year_end_date
|
||||
FROM
|
||||
{{ source(
|
||||
'crosschain',
|
||||
'dim_dates'
|
||||
) }}
|
||||
@ -12,12 +12,7 @@ SELECT
|
||||
project_name,
|
||||
label_type,
|
||||
label_subtype,
|
||||
label_type AS l1_label,
|
||||
label_subtype AS l2_label
|
||||
l1_label,
|
||||
l2_label
|
||||
FROM
|
||||
{{ source(
|
||||
'crosschain',
|
||||
'address_labels'
|
||||
) }}
|
||||
WHERE
|
||||
blockchain = 'near'
|
||||
{{ ref('silver__address_labels') }}
|
||||
|
||||
@ -27,10 +27,7 @@ dates AS (
|
||||
SELECT
|
||||
date_day
|
||||
FROM
|
||||
{{ source(
|
||||
'crosschain',
|
||||
'dim_dates'
|
||||
) }}
|
||||
{{ ref('silver__dates') }}
|
||||
WHERE
|
||||
date_day >= '2020-08-25'
|
||||
AND date_day < CURRENT_DATE
|
||||
|
||||
44
models/silver/labels/silver__address_labels.sql
Normal file
44
models/silver/labels/silver__address_labels.sql
Normal file
@ -0,0 +1,44 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = 'address',
|
||||
cluster_by = 'address'
|
||||
) }}
|
||||
|
||||
WITH address_labels AS (
|
||||
|
||||
SELECT
|
||||
system_created_at,
|
||||
blockchain,
|
||||
address,
|
||||
creator,
|
||||
label_type,
|
||||
label_subtype,
|
||||
address_name,
|
||||
project_name,
|
||||
_load_timestamp
|
||||
FROM
|
||||
{{ ref('bronze__address_labels') }}
|
||||
|
||||
{% if is_incremental() %}
|
||||
WHERE
|
||||
_load_timestamp >= (
|
||||
SELECT
|
||||
MAX(_load_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
{% endif %}
|
||||
)
|
||||
SELECT
|
||||
system_created_at,
|
||||
blockchain,
|
||||
address,
|
||||
address_name,
|
||||
project_name,
|
||||
label_type,
|
||||
label_subtype,
|
||||
label_type AS l1_label,
|
||||
label_subtype AS l2_label,
|
||||
_load_timestamp
|
||||
FROM
|
||||
address_labels
|
||||
51
models/silver/labels/silver__dates.sql
Normal file
51
models/silver/labels/silver__dates.sql
Normal file
@ -0,0 +1,51 @@
|
||||
{{ config(
|
||||
materialized = 'table',
|
||||
unique_key = 'date_day'
|
||||
) }}
|
||||
|
||||
WITH dim_dates AS (
|
||||
|
||||
SELECT
|
||||
date_day,
|
||||
prior_date_day,
|
||||
next_date_day,
|
||||
prior_year_date_day,
|
||||
prior_year_over_year_date_day,
|
||||
day_of_week,
|
||||
day_of_week_iso,
|
||||
day_of_week_name,
|
||||
day_of_week_name_short,
|
||||
day_of_month,
|
||||
day_of_year,
|
||||
week_start_date,
|
||||
week_end_date,
|
||||
prior_year_week_start_date,
|
||||
prior_year_week_end_date,
|
||||
week_of_year,
|
||||
iso_week_start_date,
|
||||
iso_week_end_date,
|
||||
prior_year_iso_week_start_date,
|
||||
prior_year_iso_week_end_date,
|
||||
iso_week_of_year,
|
||||
prior_year_week_of_year,
|
||||
prior_year_iso_week_of_year,
|
||||
month_of_year,
|
||||
month_name,
|
||||
month_name_short,
|
||||
month_start_date,
|
||||
month_end_date,
|
||||
prior_year_month_start_date,
|
||||
prior_year_month_end_date,
|
||||
quarter_of_year,
|
||||
quarter_start_date,
|
||||
quarter_end_date,
|
||||
year_number,
|
||||
year_start_date,
|
||||
year_end_date
|
||||
FROM
|
||||
{{ ref('bronze__dates') }}
|
||||
)
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dim_dates
|
||||
Loading…
Reference in New Issue
Block a user