diff --git a/macros/utils/return_limits_from_model.sql b/macros/utils/return_limits_from_model.sql index bb71662..a80e92f 100644 --- a/macros/utils/return_limits_from_model.sql +++ b/macros/utils/return_limits_from_model.sql @@ -4,7 +4,7 @@ This program is licensed to you under the Snowplow Personal and Academic License and you may not use this file except in compliance with the Snowplow Personal and Academic License Version 1.0. You may obtain a copy of the Snowplow Personal and Academic License Version 1.0 at https://docs.snowplow.io/personal-and-academic-license-1.0/ #} -{% macro return_limits_from_model(model, lower_limit_col, upper_limit_col, lower_output=False) -%} {# add comments #} +{% macro return_limits_from_model(model, lower_limit_col, upper_limit_col, lower_output=False) -%} {# In case of not execute just return empty strings to avoid hitting database #} {% if not execute %} @@ -36,11 +36,11 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0 {% do exceptions.warn("Snowplow Warning: No data in "~this~" for date range from variables, please modify your run variables to include data if this is not expected.") %} {{ snowplow_utils.log_message("Snowplow Warning: *************") }} {# This allows for bigquery to still run the same way the other warehouses do, but also ensures no data is processed #} - {# add comment here #} {% if lower_output %} {% set lower_limit = snowplow_utils.cast_to_tstamp('0000-01-01 00:00:00') %} {% set upper_limit = snowplow_utils.cast_to_tstamp('0000-01-02 00:00:00') %} {%- else -%} + {# Default behaviour for incrementalisation. This allows for bigquery to still run the same way the other warehouses do, but also ensures no data is processed #} {% set lower_limit = snowplow_utils.cast_to_tstamp('9999-01-01 00:00:00') %} {% set upper_limit = snowplow_utils.cast_to_tstamp('9999-01-02 00:00:00') %} {% endif %} diff --git a/macros/utils/schema.yml b/macros/utils/schema.yml index b28a760..80c17a1 100644 --- a/macros/utils/schema.yml +++ b/macros/utils/schema.yml @@ -92,6 +92,9 @@ macros: - name: upper_limit_col type: string description: The column to take the `max` of to get the upper limit + - name: lower_output + type: boolean + description: This changes the output to a low set date if true and high set date if false, in the event the function cannot find value but needs to set a value - name: set_query_tag description: '{{ doc("macro_set_query_tag") }}' arguments: