mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 11:47:00 +00:00
add shards
This commit is contained in:
parent
f70fa0a002
commit
43141535ab
@ -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
|
||||
|
||||
@ -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
|
||||
*,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user