mirror of
https://github.com/FlipsideCrypto/fsc-utils.git
synced 2026-02-06 10:56:49 +00:00
Merge pull request #32 from FlipsideCrypto/patch/dynamic-pred-when-tmp-table-empty
Patch/dynamic pred when tmp table empty
This commit is contained in:
commit
b0b5e61514
@ -229,7 +229,7 @@ A set of macros to help with generating dynamic merge predicate statements for m
|
||||
|
||||
The macro only supports generating predicates for column types of DATE and INTEGER
|
||||
|
||||
1. Make sure fsc-utils package referenced in the project is version `v1.16.0` or greater. Re-run dbt deps if revision was changed.
|
||||
1. Make sure fsc-utils package referenced in the project is version `v1.16.1` or greater. Re-run dbt deps if revision was changed.
|
||||
|
||||
#### Inline Usage ####
|
||||
|
||||
|
||||
@ -6,7 +6,11 @@
|
||||
WHERE {{predicate_column}} IS NOT NULL
|
||||
LIMIT 1;
|
||||
{% endset %}
|
||||
{% set predicate_column_data_type = run_query(predicate_column_data_type_query).columns[0].values()[0] %}
|
||||
{% set predicate_column_data_type_result = run_query(predicate_column_data_type_query) %}
|
||||
{% if predicate_column_data_type_result.rows|length == 0 %}
|
||||
{{ return('1=1') }}
|
||||
{% endif %}
|
||||
{% set predicate_column_data_type = predicate_column_data_type_result.columns[0].values()[0] %}
|
||||
|
||||
|
||||
{% if predicate_column_data_type not in supported_data_types %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user