-
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 #412 from basedosdados/br_camara
[dbt] br_camara_dados_abertos.orgao
- Loading branch information
Showing
4 changed files
with
201 additions
and
4 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
models/br_camara_dados_abertos/br_camara_dados_abertos__orgao.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,15 @@ | ||
{{ config(alias='orgao',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
SAFE_CAST(nome AS STRING) nome, | ||
SAFE_CAST(apelido AS STRING) apelido, | ||
SAFE_CAST(sigla AS STRING) sigla, | ||
SAFE_CAST(uri AS STRING) url_orgao, | ||
SAFE_CAST(tipoOrgao AS STRING) tipo_orgao, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataInicio)), 'T')[OFFSET(0)] AS DATE) data_inicio, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataInstalacao)), 'T')[OFFSET(0)] AS DATE) data_instalacao, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataFim)), 'T')[OFFSET(0)] AS DATE) data_final, | ||
SAFE_CAST(descricaoSituacao AS STRING) situacao, | ||
SAFE_CAST(casa AS STRING) casa, | ||
SAFE_CAST(sala AS STRING) sala, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.orgao AS t | ||
|
14 changes: 14 additions & 0 deletions
14
models/br_camara_dados_abertos/br_camara_dados_abertos__orgao_deputado.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,14 @@ | ||
{{ config(alias='orgao_deputado',schema='br_camara_dados_abertos') }} | ||
SELECT DISTINCT | ||
SAFE_CAST(nomeOrgao AS STRING) nome, | ||
SAFE_CAST(siglaOrgao AS STRING) sigla, | ||
SAFE_CAST(uriOrgao AS STRING) url, | ||
SAFE_CAST(nomeDeputado AS STRING) nome_deputado, | ||
SAFE_CAST(cargo AS STRING) cargo, | ||
SAFE_CAST(siglaUF AS STRING) sigla_uf, | ||
SAFE_CAST(dataInicio AS DATE) data_inicio, | ||
SAFE_CAST(dataFim AS DATE) data_final, | ||
SAFE_CAST(siglaPartido AS STRING) sigla_partido, | ||
SAFE_CAST(uriDeputado AS STRING) url_deputado | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.orgao_deputado 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