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:
desmond-hui 2024-02-08 07:25:02 -08:00 committed by GitHub
commit b0b5e61514
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -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 ####

View File

@ -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 %}