Skip to content

Commit

Permalink
feat: update models
Browse files Browse the repository at this point in the history
  • Loading branch information
folhesgabriel committed Dec 16, 2024
1 parent 47064a1 commit a73bd31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
pre_hook="DROP ALL ROW ACCESS POLICIES ON {{ this }}",
)
}}

select
safe_cast(ano as int64) ano,
safe_cast(mes as int64) mes,
safe_cast(SUBSTRING(competenciamov, 1, 4) as int64) ano_competencia_movimentacao,
safe_cast(SUBSTRING(competenciamov, 5, 6) as int64) mes_competencia_movimentacao,
safe_cast(a.sigla_uf as string) sigla_uf,
safe_cast(b.id_municipio as string) id_municipio,
safe_cast(cnae_2_secao as string) cnae_2_secao,
Expand Down Expand Up @@ -44,5 +47,5 @@ select
safe_cast(indicador_fora_prazo as int64) indicador_fora_prazo
from `basedosdados-dev.br_me_caged_staging.microdados_movimentacao_excluida` a
left join
`basedosdados-dev.br_bd_diretorios_brasil.municipio` b
`basedosdados.br_bd_diretorios_brasil.municipio` b
on a.id_municipio = b.id_municipio_6
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
pre_hook="DROP ALL ROW ACCESS POLICIES ON {{ this }}",
)
}}


select
safe_cast(ano as int64) ano,
safe_cast(mes as int64) mes,
safe_cast(SUBSTRING(competenciamov, 1, 4) as int64) ano_competencia_movimentacao,
safe_cast(SUBSTRING(competenciamov, 5, 6) as int64) mes_competencia_movimentacao,
safe_cast(a.sigla_uf as string) sigla_uf,
safe_cast(b.id_municipio as string) id_municipio,
safe_cast(cnae_2_secao as string) cnae_2_secao,
Expand Down Expand Up @@ -48,7 +52,7 @@ select
safe_cast(indicador_fora_prazo as int64) indicador_fora_prazo
from `basedosdados-dev.br_me_caged_staging.microdados_movimentacao_fora_prazo` a
left join
`basedosdados-dev.br_bd_diretorios_brasil.municipio` b
`basedosdados.br_bd_diretorios_brasil.municipio` b
on a.id_municipio = b.id_municipio_6
{% if is_incremental() %}
where
Expand Down

0 comments on commit a73bd31

Please sign in to comment.