Skip to content

Commit

Permalink
Merge branch 'main' into add_format_sql
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 6, 2025
2 parents f592e75 + f3dcb3c commit 320579a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pipelines/migration/br_rj_riodejaneiro_bilhetagem/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Flows for br_rj_riodejaneiro_bilhetagem
DBT: 2025-01-02
DBT: 2025-01-06
"""

from copy import deepcopy
Expand Down
31 changes: 19 additions & 12 deletions queries/models/br_rj_riodejaneiro_bilhetagem/integracao.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,27 @@
{% if execute %}
{% if is_incremental() %}
{% set integracao_partitions_query %}

SELECT DISTINCT
CONCAT("'", DATE(data_transacao), "'") AS data_transacao
WITH integracao AS (
SELECT DISTINCT
CONCAT("'", DATE(data_transacao), "'") AS data_transacao
FROM
{{ integracao_staging }},
UNNEST([
data_transacao_t0,
data_transacao_t1,
data_transacao_t2,
data_transacao_t3,
data_transacao_t4
]) AS data_transacao
WHERE
{{ incremental_filter }}
)
SELECT
*
FROM
{{ integracao_staging }},
UNNEST([
data_transacao_t0,
data_transacao_t1,
data_transacao_t2,
data_transacao_t3,
data_transacao_t4
]) AS data_transacao
integracao
WHERE
{{ incremental_filter }}
data_transacao IS NOT NULL

{% endset %}

Expand Down

0 comments on commit 320579a

Please sign in to comment.