-
Notifications
You must be signed in to change notification settings - Fork 13
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
Showing
4 changed files
with
105 additions
and
113 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
{{ config( | ||
severity = "error", | ||
tags = ['gap_test'] | ||
) }} | ||
|
||
|
||
WITH r_receipts AS ( | ||
SELECT | ||
DISTINCT receipt_id, | ||
block_id, | ||
predecessor_id AS signer_id | ||
FROM | ||
{{ ref('silver__streamline_receipts') }} | ||
|
||
{% if var('DBT_FULL_TEST') %} | ||
WHERE | ||
_inserted_timestamp < SYSDATE() - INTERVAL '1 hour' | ||
{% else %} | ||
WHERE | ||
_inserted_timestamp BETWEEN SYSDATE() - INTERVAL '7 days' | ||
AND SYSDATE() - INTERVAL '1 hour' | ||
{% endif %} | ||
), | ||
f_receipts AS ( | ||
SELECT | ||
DISTINCT receipt_object_id AS receipt_id, | ||
block_id, | ||
receipt_actions :predecessor_id :: STRING AS signer_id | ||
FROM | ||
{{ ref('silver__streamline_receipts_final') }} | ||
|
||
{% if var('DBT_FULL_TEST') %} | ||
WHERE | ||
_inserted_timestamp < SYSDATE() - INTERVAL '1 hour' | ||
{% else %} | ||
WHERE | ||
_inserted_timestamp BETWEEN SYSDATE() - INTERVAL '7 days' | ||
AND SYSDATE() - INTERVAL '1 hour' | ||
{% endif %} | ||
) | ||
SELECT | ||
r_receipts.receipt_id AS receipt_id, | ||
r_receipts.block_id, | ||
r_receipts.signer_id | ||
FROM | ||
r_receipts | ||
LEFT JOIN | ||
f_receipts | ||
ON | ||
r_receipts.receipt_id = f_receipts.receipt_id | ||
WHERE | ||
f_receipts.receipt_id IS NULL |
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,53 @@ | ||
{{ config( | ||
severity = "error", | ||
tags = ['gap_test'] | ||
) }} | ||
|
||
|
||
WITH | ||
r_transactions AS ( | ||
SELECT | ||
DISTINCT tx_hash, | ||
block_id, | ||
_signer_id AS signer_id | ||
FROM | ||
{{ ref('silver__streamline_transactions') }} | ||
|
||
{% if var('DBT_FULL_TEST') %} | ||
WHERE | ||
_inserted_timestamp < SYSDATE() - INTERVAL '1 hour' | ||
{% else %} | ||
WHERE | ||
_inserted_timestamp BETWEEN SYSDATE() - INTERVAL '7 days' | ||
AND SYSDATE() - INTERVAL '1 hour' | ||
{% endif %} | ||
), | ||
f_transactions AS ( | ||
SELECT | ||
DISTINCT tx_hash, | ||
block_id, | ||
tx_signer AS signer_id | ||
FROM | ||
{{ ref('silver__streamline_transactions_final') }} | ||
|
||
{% if var('DBT_FULL_TEST') %} | ||
WHERE | ||
_inserted_timestamp < SYSDATE() - INTERVAL '1 hour' | ||
{% else %} | ||
WHERE | ||
_inserted_timestamp BETWEEN SYSDATE() - INTERVAL '7 days' | ||
AND SYSDATE() - INTERVAL '1 hour' | ||
{% endif %} | ||
) | ||
SELECT | ||
r_transactions.tx_hash AS tx_hash, | ||
r_transactions.block_id, | ||
r_transactions.signer_id | ||
FROM | ||
r_transactions | ||
LEFT JOIN | ||
f_transactions | ||
ON | ||
r_transactions.tx_hash = f_transactions.tx_hash | ||
WHERE | ||
f_transactions.tx_hash IS NULL |