Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] br_ibge_pnadc__microdados #343

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions models/br_ibge_pnadc/br_ibge_pnadc__microdados.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
labels = {'project_id': 'basedosdados-dev', 'tema': 'economia'})
}}

SELECT
SELECT
SAFE_CAST(ano AS INT64) ano,
SAFE_CAST(trimestre AS INT64) trimestre,
SAFE_CAST(id_uf AS STRING) id_uf,
Expand All @@ -23,9 +23,10 @@ SAFE_CAST(capital AS STRING) capital,
SAFE_CAST(rm_ride AS STRING) rm_ride,
SAFE_CAST(id_upa AS STRING) id_upa,
SAFE_CAST(id_estrato AS STRING) id_estrato,
SAFE_CAST(id_domicilio AS STRING) id_domicilio,
SAFE_CAST(V1008 AS INT64) V1008,
SAFE_CAST(V1014 AS INT64) V1014,
SAFE_CAST(CONCAT(id_upa,lpad(V1008,2,'0'),lpad(V1014,2,'0')) AS STRING) id_domicilio,
SAFE_CAST(CONCAT(id_upa,lpad(V1008,2,'0'),lpad(V1014,2,'0'), lpad(V2003,2,'0')) AS STRING) id_pessoa,
SAFE_CAST(lpad(V1008,2,'0') AS STRING) V1008,
SAFE_CAST(lpad(V1014,2,'0') AS STRING) V1014,
SAFE_CAST(V1016 AS INT64) V1016,
SAFE_CAST(V1022 AS STRING) V1022,
SAFE_CAST(V1023 AS STRING) V1023,
Expand Down
2 changes: 2 additions & 0 deletions models/br_ibge_pnadc/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ models:
description: ID Estrato (As 2 primeiras posições representam o código da Unidade da Federação)
- name: id_domicilio
description: ID Domicílio
- name: id_pessoa
description: ID Pessoa Entrevistada
- name: V1008
description: Número de seleção do domicílio
- name: V1014
Expand Down
Loading