add shards

This commit is contained in:
Jack Forgash 2024-07-15 09:49:03 -06:00
parent f70fa0a002
commit 43141535ab
2 changed files with 7 additions and 32 deletions

View File

@ -20,12 +20,8 @@ WITH external_blocks AS (
"blocks"
) }}
WHERE
_partition_by_block_number >= (
SELECT
MAX(_partition_by_block_number) - (3000 * {{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }})
FROM
{{ this }}
)
_partition_by_block_number = 122556000
and value:header:height::NUMBER between 122556416 and 122556516
),
meta AS (
SELECT
@ -36,7 +32,7 @@ meta AS (
information_schema.external_table_file_registration_history(
start_time => DATEADD(
'hour',
-{{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }},
-155,
SYSDATE()
),
table_name => '{{ source( 'streamline', 'blocks' ) }}'
@ -72,15 +68,7 @@ blocks AS (
LEFT JOIN meta m USING (
_filename
)
{% if is_incremental() %}
WHERE
_inserted_timestamp >= (
SELECT
MAX(_inserted_timestamp)
FROM
{{ this }}
)
{% endif %}
)
SELECT

View File

@ -20,12 +20,8 @@ WITH external_shards AS (
"shards"
) }}
WHERE
_partition_by_block_number >= (
SELECT
MAX(_partition_by_block_number) - (3000 * {{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }})
FROM
{{ this }}
)
_partition_by_block_number = 122556000
and value:header:height::NUMBER between 122556416 and 122556516
),
meta AS (
SELECT
@ -36,7 +32,7 @@ meta AS (
information_schema.external_table_file_registration_history(
start_time => DATEADD(
'hour',
-{{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }},
-320,
SYSDATE()
),
table_name => '{{ source( 'streamline', 'shards' ) }}'
@ -66,15 +62,6 @@ shards AS (
external_shards e
LEFT JOIN meta m USING (_filename)
{% if is_incremental() %}
WHERE
_inserted_timestamp >= (
SELECT
MAX(_inserted_timestamp)
FROM
{{ this }}
)
{% endif %}
)
SELECT
*,