mirror of
https://github.com/FlipsideCrypto/optimism-models.git
synced 2026-02-06 13:41:55 +00:00
* new columns, deprecation notices, docs * docs and ymls * new column in silver logs * spacing * spacing * new decoded logs columns, updates for new core columns * updates for column changes * nft updates * minor updates * comments * docs * updates for native transfers * update for identifier * updates for identifier * deprecation notices updated * table notices * native transfers * core column changes and docs * misc updates * typo * ref * removed trace_address from native_transfers * misc updates * timestamps for native * missing changes * misc updates * nft updates * missing_decoding macro * l1 fee precise docs * removed trace address column from silver native transfers * deprecation date * ez_decoded_event_logs * standard pred * dbt_mega
23 lines
725 B
SQL
23 lines
725 B
SQL
{% macro standard_predicate(
|
|
input_column = 'block_number'
|
|
) -%}
|
|
{%- set database_name = target.database -%}
|
|
{%- set schema_name = generate_schema_name(
|
|
node = model
|
|
) -%}
|
|
{%- set table_name = generate_alias_name(
|
|
node = model
|
|
) -%}
|
|
{%- set tmp_table_name = table_name ~ '__dbt_tmp' -%}
|
|
{%- set full_table_name = database_name ~ '.' ~ schema_name ~ '.' ~ table_name -%}
|
|
{%- set full_tmp_table_name = database_name ~ '.' ~ schema_name ~ '.' ~ tmp_table_name -%}
|
|
{{ full_table_name }}.{{ input_column }} >= (
|
|
SELECT
|
|
MIN(
|
|
{{ input_column }}
|
|
)
|
|
FROM
|
|
{{ full_tmp_table_name }}
|
|
)
|
|
{%- endmacro %}
|