Macros: Other: Incremental Predicates - FlipsideCrypto/fsc-evm GitHub Wiki
The following macros are intended to be used to load data more efficiently when merging to or deleting from a table. These macros can be accessed via version >=v1.5.0
of the fsc-evm
package. Please see the fsc-evm
installation instructions in the README for more details on how to access and utilize this macro effectively.
standard_predicate
Usage
This macro adds a filter to the delete
statement for efficiency purposes. For example: dest_table.input_column >= (select min(input_column) from source_table)
Parameters
Note: Parameters with default
values must be ordered after non-default parameters.
Parameter | Type | Default | Description |
---|---|---|---|
input_column |
STRING | block_number |
This is the column you want to find the minimum of from incremental data. The param is a string and should be a column name, but the column type should be a number , float or date . |
Example
{{ config (
...,
incremental_predicates = [fsc_evm.standard_predicate()],
...
) }}
-- or
{{ config (
...,
incremental_predicates = [fsc_evm.standard_predicate('slot_number')],
...
) }}
... `