-
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 branch 'master' into staging/caged_grant
- Loading branch information
Showing
4 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
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,23 @@ | ||
{{ | ||
config( | ||
schema='br_bd_diretorios_brasil', | ||
materialized='table', | ||
partition_by={ | ||
"field": "sigla_uf", | ||
"data_type": "string", | ||
} | ||
) | ||
}} | ||
|
||
SELECT | ||
SAFE_CAST(lpad(cep, 8, '0') AS STRING) cep, | ||
SAFE_CAST(logradouro AS STRING) logradouro, | ||
SAFE_CAST(complemento AS STRING) complemento, | ||
SAFE_CAST(bairro AS STRING) bairro, | ||
SAFE_CAST(cidade AS STRING) cidade, | ||
SAFE_CAST(id_municipio AS STRING) id_municipio, | ||
SAFE_CAST(sigla_uf AS STRING) sigla_uf, | ||
SAFE_CAST(latitude AS FLOAT64) latitude, | ||
SAFE_CAST(longitude AS FLOAT64) longitude, | ||
ST_GEOGPOINT(SAFE_CAST(longitude AS FLOAT64),SAFE_CAST(latitude AS FLOAT64)) centroide | ||
FROM basedosdados-staging.br_bd_diretorios_brasil_staging.cep 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
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
SELECT | ||
SAFE_CAST(ano_competencia AS INT64) ano_competencia, | ||
SAFE_CAST(mes_competencia AS INT64) mes_competencia, | ||
SAFE_CAST(ano_caixa AS INT64) ano_caixa, | ||
SAFE_CAST(mes_caixa AS INT64) mes_caixa, | ||
SAFE_CAST(SAFE_CAST(ano_competencia AS NUMERIC) AS INT64) ano_competencia, | ||
SAFE_CAST(SAFE_CAST(mes_competencia AS NUMERIC) AS INT64) mes_competencia, | ||
SAFE_CAST(SAFE_CAST(ano_caixa AS NUMERIC) AS INT64) ano_caixa, | ||
SAFE_CAST(SAFE_CAST(mes_caixa AS NUMERIC) AS INT64) mes_caixa, | ||
SAFE_CAST(categoria AS STRING) categoria, | ||
SAFE_CAST(tipo AS STRING) tipo, | ||
SAFE_CAST(frequencia AS STRING) frequencia, | ||
SAFE_CAST(valor AS FLOAT64) valor | ||
SAFE_CAST(equipe AS STRING) equipe, | ||
SAFE_CAST(SAFE_CAST(valor AS NUMERIC) AS FLOAT64) valor | ||
FROM basedosdados-staging.br_bd_indicadores_staging.contabilidade 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