Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dapollak committed Sep 26, 2023
1 parent 9bbd773 commit ae6cc73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions macros/utils/cross_db_utils/datediff.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{ return(adapter.dispatch('edr_datediff', 'elementary')(first_date, second_date, date_part)) }}
{% endmacro %}

{# For Snowflake, Databricks, Redshift, Postgres & Spark #}
{# For Snowflake, Databricks, Redshift, Postgres #}
{# the dbt adapter implementation supports both timestamp and dates #}
{% macro default__edr_datediff(first_date, second_date, date_part) %}
{% set macro = dbt.datediff or dbt_utils.datediff %}
Expand All @@ -26,7 +26,8 @@
{%- endif %}
{% endmacro %}


{# dbt-spark implementation has an off by one for datepart == "hour" #}
{# because it uses CEIL instead of FLOOR #}
{% macro spark__edr_datediff(first_date, second_date, datepart) %}
{%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}

Expand Down

0 comments on commit ae6cc73

Please sign in to comment.