Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 10, 2024
1 parent 5b492b5 commit 1547c89
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions queries/models/adm_central_atendimento_1746/chamado_cpf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@

-- Full refresh or new rows for incremental runs
with base_data as (
select
select
p.cpf,
c.* -- Select all columns from the chamado table
from `rj-segovi.adm_central_atendimento_1746.chamado` c
left join `rj-segovi.adm_central_atendimento_1746.chamado_pessoa` cp
on c.id_chamado = cp.id_chamado
left join `rj-segovi.adm_central_atendimento_1746.pessoa` p
on cp.id_pessoa = p.id_pessoa
where
where
c.id_chamado is not null
and cp.id_pessoa is not null
and p.cpf is not null
),
filtered_increment as (
{% if is_incremental() %}
-- Only add data not already in the target table
select *
select *
from base_data
where id_chamado not in (
select id_chamado
from {{ this }}
)
{% else %}
-- For full refreshes, include all rows
select *
select *
from base_data
{% endif %}
)
select
select
cpf,
* except(cpf) -- Include all columns except duplicating cpf
from filtered_increment

0 comments on commit 1547c89

Please sign in to comment.