-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from basedosdados/censo-2022-coordenadas
[dbt]: `br_ibge_censo_2022.coordenada_endereco`
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
models/br_ibge_censo_2022/br_ibge_censo_2022__coordenada_endereco.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{ | ||
config(alias='coordenada_endereco', | ||
schema='br_ibge_censo_2022', | ||
materialized='table', | ||
cluster_by = ["id_municipio", "id_uf", "especie_endereco"])}} | ||
|
||
SELECT | ||
SAFE_CAST(id_uf AS STRING) id_uf, | ||
SAFE_CAST(COD_MUN AS STRING) id_municipio, | ||
SAFE_CAST(COD_ESPECIE AS STRING) especie_endereco, | ||
SAFE_CAST(NV_GEO_COORD AS STRING) nivel_geo_coordenada, | ||
SAFE_CAST(LATITUDE AS FLOAT64) latitude, | ||
SAFE_CAST(LONGITUDE AS FLOAT64) longitude, | ||
ST_GEOGPOINT(SAFE_CAST(LONGITUDE AS FLOAT64),SAFE_CAST(LATITUDE AS FLOAT64)) ponto | ||
FROM basedosdados-staging.br_ibge_censo_2022_staging.coordenada_endereco AS t | ||
|
||
|
||
|
10 changes: 10 additions & 0 deletions
10
models/br_ibge_censo_2022/br_ibge_censo_2022__dicionario.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{ config(alias='dicionario', schema='br_ibge_censo_2022') }} | ||
|
||
SELECT | ||
SAFE_CAST(id_tabela AS STRING) id_tabela, | ||
SAFE_CAST(nome_coluna AS STRING) nome_coluna, | ||
SAFE_CAST(chave AS STRING) chave, | ||
SAFE_CAST(cobertura_temporal AS STRING) cobertura_temporal, | ||
SAFE_CAST(valor AS STRING) valor | ||
|
||
FROM basedosdados-staging.br_ibge_censo_2022_staging.dicionario AS t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters