-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Horace Liu
authored and
Horace Liu
committed
Dec 19, 2024
1 parent
e838dd4
commit 68e9d90
Showing
18 changed files
with
119 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key=["address", "chain", "source"], | ||
incremental_strategy="merge", | ||
) | ||
}} | ||
|
||
-- There will inevitably be addres + chain duplicates, but we will take care of this downstream when we don't care about the source anymore | ||
with unioned_table as ( | ||
SELECT address, chain, 'sigma' AS source, OBJECT_CONSTRUCT( | ||
'name', name | ||
) AS metadata, | ||
last_updated | ||
FROM {{ ref("dim_legacy_sigma_tagged_contracts") }} | ||
UNION ALL | ||
SELECT address, chain, 'dune' AS source, OBJECT_CONSTRUCT( | ||
'name', name | ||
) AS metadata, | ||
last_updated | ||
FROM {{ ref("dim_dune_contracts") }} | ||
UNION ALL | ||
SELECT address, chain, 'sui' AS source, OBJECT_CONSTRUCT( | ||
'name', name, 'icon', icon | ||
) AS metadata, | ||
last_updated | ||
FROM {{ ref("dim_sui_contracts") }} | ||
UNION ALL | ||
SELECT address, chain, 'flipside' AS source, OBJECT_CONSTRUCT( | ||
'name', name | ||
) AS metadata, | ||
last_updated | ||
FROM {{ ref("dim_flipside_contracts") }} | ||
) select * from unioned_table | ||
{% if is_incremental() %} | ||
where last_updated > (SELECT MAX(last_updated) FROM {{ this }}) | ||
{% endif %} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.