Skip to content

Commit

Permalink
Merge pull request #8 from bcodell/hotfix-join-logic
Browse files Browse the repository at this point in the history
update between join logic
  • Loading branch information
bcodell authored May 22, 2023
2 parents 23db48d + 466122d commit 2763d01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion macros/activity_schema/dataset/joins/_join_clauses.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

{% macro _join_clause_between() %}
{%- set ts = dbt_aql.schema_columns().ts -%}
{%- set next_ts = dbt_aql.schema_columns().activity_repeated_at -%}
{%- set req = dbt_aql._required_prefix() -%}
{{dbt_aql.primary()}}.{{req}}{{ts}} < {{dbt_aql.joined()}}.{{ts}}
{{dbt_aql.primary()}}.{{req}}{{ts}} < {{dbt_aql.joined()}}.{{ts}} and ({{dbt_aql.primary()}}.{{req}}{{next_ts}} > {{dbt_aql.joined()}}.{{ts}} or {{dbt_aql.primary()}}.{{req}}{{next_ts}} is null)
{%- endmacro %}

{% macro _join_clause_all() %}
Expand Down

0 comments on commit 2763d01

Please sign in to comment.