-
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.
feat: add coordenada-endereco query and schema
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
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,22 @@ | ||
{{ | ||
config(alias='coordenada_endereco', | ||
schema='br_ibge_censo_2022', | ||
materialized='table', | ||
partition_by={ | ||
"field": "id_uf", | ||
"data_type": "int64", | ||
}, | ||
cluster_by = ["id_municipio"])}} | ||
|
||
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 | ||
|
||
|
||
|
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