Skip to content

Commit

Permalink
Merge pull request #622 from basedosdados/censo_2022
Browse files Browse the repository at this point in the history
[fix] br_ibge_censo_2022
  • Loading branch information
laura-l-amaral authored Nov 7, 2024
2 parents a94818f + a243656 commit b5dc06b
Show file tree
Hide file tree
Showing 62 changed files with 927 additions and 2,176 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{
config(
alias="alfabetizacao_grupo_idade_sexo_raca",
schema="br_ibge_censo_2022",
)
}}
select
safe_cast(municipio_codigo_ as string) id_municipio,
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(sexo as string) sexo,
safe_cast(idade as string) grupo_idade,
safe_cast(alfabetizacao as string) alfabetizacao,
safe_cast(valor as int64) populacao,
from
`basedosdados-dev.br_ibge_censo_2022_staging.alfabetizacao_grupo_idade_sexo_raca`
as t

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ select
safe_cast(val_comp_elem4 as string) complemento_valor_4,
safe_cast(nom_comp_elem5 as string) complemento_elemento_5,
safe_cast(val_comp_elem5 as string) complemento_valor_5,
safe_cast(latitude as string) latitude,
safe_cast(longitude as string) longitude,
st_geogpoint(safe_cast(longitude as float64), safe_cast(latitude as float64)) ponto,
safe_cast(nv_geo_coord as string) nivel_geocodificacao_coordenadas,
safe_cast(dsc_estabelecimento as string) descricao_estabelecimento,
safe_cast(cod_especie as string) tipo_especie,
safe_cast(cod_indicador_estab_endereco as string) tipo_estabelecimento,
safe_cast(cod_indicador_const_endereco as string) tipo_construcao,
safe_cast(cod_indicador_finalidade_const as string) tipo_finalidade_construcao,
safe_cast(cod_tipo_especi as string) tipo_edificacao_domicilio,
safe_cast(nv_geo_coord as string) nivel_geocodificacao_coordenadas,
safe_cast(latitude as string) latitude,
safe_cast(longitude as string) longitude,
st_geogpoint(safe_cast(longitude as float64), safe_cast(latitude as float64)) ponto
from `basedosdados-dev.br_ibge_censo_2022_staging.cadastro_enderecos` as t
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{
config(
alias="morador_cor_raca_destino_lixo_municipio", schema="br_ibge_censo_2022"
alias="caracteristica_domicilio_grupo_idade_raca_destino_lixo",
schema="br_ibge_censo_2022",
)
}}
select
Expand All @@ -11,7 +12,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-dev.br_ibge_censo_2022_staging.morador_cor_raca_destino_lixo_municipio`
`basedosdados-dev.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_destino_lixo`
as t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
alias="morador_cor_raca_esgotamento_sanitario_municipio",
alias="caracteristica_domicilio_grupo_idade_raca_esgotamento_sanitario",
schema="br_ibge_censo_2022",
)
}}
Expand All @@ -12,7 +12,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-dev.br_ibge_censo_2022_staging.morador_cor_raca_esgotamento_sanitario_municipio`
`basedosdados-dev.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_esgotamento_sanitario`
as t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
alias="morador_cor_raca_ligacao_abastecimento_agua_municipio",
alias="caracteristica_domicilio_grupo_idade_raca_ligacao_abastecimento_agua",
schema="br_ibge_censo_2022",
)
}}
Expand All @@ -15,7 +15,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-dev.br_ibge_censo_2022_staging.morador_cor_raca_ligacao_abastecimento_agua_municipio`
`basedosdados-dev.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_ligacao_abastecimento_agua`
as t
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{
config(
alias="morador_cor_raca_tipo_domicilio_municipio",
alias="caracteristica_domicilio_grupo_idade_raca_tipo_domicilio",
schema="br_ibge_censo_2022",
tag=["refazer"],
)
}}
select
Expand All @@ -12,7 +13,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-dev.br_ibge_censo_2022_staging.morador_cor_racao_tipo_domicilio_municipio`
`basedosdados-dev.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_tipo_domicilio`
as t

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{
config(
alias="domicilio_recenseado_especie_municipio", schema="br_ibge_censo_2022"
)
}}
{{ config(alias="domicilio_recenseado", schema="br_ibge_censo_2022") }}
with
ibge as (
select
Expand All @@ -15,9 +11,7 @@ with
) sigla_uf,
safe_cast(especie as string) especie,
safe_cast(domicilios_recenseados_domicilios_ as int64) domicilios,
from
`basedosdados-dev.br_ibge_censo_2022_staging.domicilio_recenseado_especie_municipio`
as t
from `basedosdados-dev.br_ibge_censo_2022_staging.domicilio_recenseado` as t
)
select t2.cod as id_municipio, ibge.* except (municipio, nome_municipio, sigla_uf)
from ibge
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{
config(
alias="indice_envelhecimento_cor_raca_municipio", schema="br_ibge_censo_2022"
)
}}
{{ config(alias="indice_envelhecimento_raca", schema="br_ibge_censo_2022") }}
select
safe_cast(ano as int64) ano,
safe_cast(cod_ as string) id_municipio,
Expand All @@ -14,6 +10,4 @@ select
) indice_envelhecimento,
safe_cast(idade_mediana_anos_ as int64) idade_mediana,
safe_cast(replace(razao_de_sexo_razao_, ",", ".") as float64) razao_sexo,
from
`basedosdados-dev.br_ibge_censo_2022_staging.indice_envelhecimento_cor_raca_municipio`
as t
from `basedosdados-dev.br_ibge_censo_2022_staging.indice_envelhecimento_raca` t

This file was deleted.

Loading

0 comments on commit b5dc06b

Please sign in to comment.