Skip to content

Commit

Permalink
Partition Gitcoin Eth Donations by month (duneanalytics#4634)
Browse files Browse the repository at this point in the history
* Partition Gitcoin Eth Donations by month

* More block_month partitions
  • Loading branch information
couralex6 authored Oct 19, 2023
1 parent 69cbaf2 commit 43e1751
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion models/gitcoin/ethereum/gitcoin_ethereum_donations.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
tags=['dunesql'],
alias = alias('donations'),
partition_by = ['block_date'],
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
Expand Down Expand Up @@ -51,6 +51,7 @@ SELECT 'ethereum' AS blockchain
, 'v1' AS version
, grd.round_name AS grant_round
, date_trunc('day', gd.block_time) AS block_date
, CAST(date_trunc('month', gd.block_time) AS DATE) AS block_month
, gd.block_time
, gd.block_number
, gd.amount_raw
Expand Down
3 changes: 2 additions & 1 deletion models/gitcoin/gitcoin_donations.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
tags=['dunesql'],
alias = alias('donations'),
partition_by = ['block_date'],
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
Expand All @@ -27,6 +27,7 @@ FROM (
version,
grant_round,
block_date,
block_month,
block_time,
block_number,
amount_raw,
Expand Down
3 changes: 2 additions & 1 deletion models/gitcoin/polygon/gitcoin_polygon_donations.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
tags=['dunesql'],
alias = alias('donations'),
partition_by = ['block_date'],
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
Expand Down Expand Up @@ -51,6 +51,7 @@ SELECT 'polygon' AS blockchain
, 'v1' AS version
, grd.round_name AS grant_round
, date_trunc('day', gd.block_time) AS block_date
, CAST(date_trunc('month', gd.block_time) AS DATE) AS block_month
, gd.block_time
, gd.block_number
, gd.amount_raw
Expand Down

0 comments on commit 43e1751

Please sign in to comment.