Skip to content

Commit

Permalink
Merge pull request #376 from basedosdados/staging/br_ibge_censo_2022
Browse files Browse the repository at this point in the history
[dbt] censo2022
  • Loading branch information
arthurfg authored Dec 22, 2023
2 parents 260d33a + 8606208 commit 2a562ed
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ FROM basedosdados-staging.br_ibge_censo_2022_staging.area_territorial_densidade_
select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio
on ibge.municipio = t2.municipio

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ FROM basedosdados-staging.br_ibge_censo_2022_staging.domicilios_moradores_munici
select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio
on ibge.municipio = t2.municipio

Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio

Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio

Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ on ibge.municipio = t2.municipio




Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ SAFE_CAST(domicilios_particulares_permanentes_ocupados_localizados_em_terras_ind
SAFE_CAST(moradores_em_domicilios_particulares_permanentes_ocupados_localizados_em_terras_indigenas_pessoas_ AS INT64) moradores,
SAFE_CAST(moradores_indigenas_em_domicilios_particulares_permanentes_ocupados_localizados_em_terras_indigenas_pessoas_ AS INT64) moradores_indigenas,
#SAFE_CAST(REPLACE(media_de_moradores_indigenas_em_domicilios_particulares_permanentes_ocupados_com_pelo_menos_um_morador_indigena_localizados_em_terras_indigenas_pessoas_, ",", ".") AS FLOAT64) media_moradores_indigenas_domicilios_terras_indigenas,
FROM basedosdados-staging.br_ibge_censo_2022_staging.domicilios_moradores_terras_indigenas AS t
FROM basedosdados-staging.br_ibge_censo_2022_staging.domicilios_moradores_terras_indigenas AS t

Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio



Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ SAFE_CAST(moradores_em_domicilios_particulares_permanentes_ocupados_com_pelo_men
SAFE_CAST(moradores_indigenas_em_domicilios_particulares_permanentes_ocupados_com_pelo_menos_um_morador_indigena_pessoas_ AS INT64) moradores_indigenas,
#SAFE_CAST(REPLACE(media_de_moradores_indigenas_em_domicilios_particulares_permanentes_ocupados_com_pelo_menos_um_morador_indigena_pessoas_, ",", ".") AS FLOAT64) media_moradores_indigenas_domicilios_terras_indigenas_pelo_menos_um,
FROM basedosdados-staging.br_ibge_censo_2022_staging.domicilios_pelo_menos_um_moradore_terras_indigenas AS t


Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ FROM basedosdados-staging.br_ibge_censo_2022_staging.indigenas_populacao_residen
select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio
on ibge.municipio = t2.municipio

Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ SAFE_CAST(TRIM(REGEXP_EXTRACT(terra_indigena_por_unidade_da_federacao, r'([^\(]+
SAFE_CAST(pessoas_residentes_em_terras_indigenas_pessoas_ AS INT64) populacao_residente,
SAFE_CAST(pessoas_indigenas_residentes_em_terras_indigenas_pessoas_ AS INT64) pessoas_indigenas,
SAFE_CAST(quesito_de_declaracao_indigena AS STRING) quesito_declaracao_indigena,
FROM basedosdados-staging.br_ibge_censo_2022_staging.populacao_residente_terras_indigenas AS t
FROM basedosdados-staging.br_ibge_censo_2022_staging.populacao_residente_terras_indigenas AS t

Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ on t.unidade_da_federacao = t2.nome





Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio


Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ SAFE_CAST(moradores_quilombolas_em_domicilios_particulares_permanentes_ocupados_
#SAFE_CAST(media_moradores_domicilios_pelo_menos_um_territorios_quilombolas AS FLOAT64) media_moradores_domicilios_pelo_menos_um_territorios_quilombolas,
#SAFE_CAST(media_moradores_quilombolas_domicilios_pelo_menos_um_territorios_quilombolas AS FLOAT64) media_moradores_quilombolas_domicilios_pelo_menos_um_territorios_quilombolas,
FROM basedosdados-staging.br_ibge_censo_2022_staging.quilombolas_domicilio_morador_territorio_quilombola AS t


Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio



Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ SAFE_CAST(domicilios_particulares_permanentes_ocupados_com_pelo_menos_um_morador
SAFE_CAST(moradores_em_domicilios_particulares_permanentes_ocupados_com_pelo_menos_um_morador_quilombola_pessoas_ AS INT64) moradores,
SAFE_CAST(moradores_quilombolas_em_domicilios_particulares_permanentes_ocupados_com_pelo_menos_um_morador_quilombola_pessoas_ AS INT64) moradores_quilombolas,
FROM basedosdados-staging.br_ibge_censo_2022_staging.quilombolas_domicilio_pelo_menos_um_morador_quilombola_territorio_quilombola_territorio_quilombola AS t


Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ FROM basedosdados-staging.br_ibge_censo_2022_staging.quilombolas_populacao_resid
select t2.cod as id_municipio, ibge.* except(municipio, nome_municipio,sigla_uf)
from ibge
left join `basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio
on ibge.municipio = t2.municipio

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ SAFE_CAST(TRIM(REGEXP_EXTRACT(territorio_quilombola_por_unidade_da_federacao, r'
SAFE_CAST(TRIM(REGEXP_EXTRACT(territorio_quilombola_por_unidade_da_federacao, r'\(([^)]+)\)')) AS STRING) sigla_uf,
SAFE_CAST(pessoas_quilombolas_residentes_em_territorios_quilombolas_pessoas_ AS INT64) pessoas_quilombolas,
SAFE_CAST(pessoas_residentes_em_territorios_quilombolas_pessoas_ AS INT64) populacao_residente,
FROM basedosdados-staging.br_ibge_censo_2022_staging.populacao_residente_territorios_quilombolas AS t
FROM basedosdados-staging.br_ibge_censo_2022_staging.populacao_residente_territorios_quilombolas AS t

2 changes: 1 addition & 1 deletion models/br_ibge_censo_2022/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2

models:
- name: br_ibge_censo_2022__quilombolas_domicilio_morador_municipio
description: Domicílios particulares permanentes ocupados e Moradores, total e quilombolas, em domicílios particulares permanentes, segundo localização do domicílio.
description: Domicílios particulares permanentes ocupados e Moradores, total e quilombolas, em domicílios particulares permanentes, segundo localização do domicílio.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
Expand Down

0 comments on commit 2a562ed

Please sign in to comment.