-
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.
- Loading branch information
Showing
8 changed files
with
707 additions
and
204 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
models/br_camara_dados_abertos/br_camara_dados_abertos__evento.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='evento',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
SAFE_CAST(id AS STRING) id, | ||
SAFE_CAST(uri AS STRING) url, | ||
SAFE_CAST(urlDocumentoPauta AS STRING) url_documento_pauta, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataHoraInicio)), 'T')[OFFSET(0)] AS DATE) data_inicio, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataHoraInicio)), 'T')[OFFSET(1)] AS TIME) horario_inicio, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataHoraFim)), 'T')[OFFSET(0)] AS DATE) data_final, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataHoraFim)), 'T')[OFFSET(1)] AS TIME) horario_final, | ||
SAFE_CAST(situacao AS STRING) situacao, | ||
SAFE_CAST(descricao AS STRING) descricao, | ||
SAFE_CAST(descricaoTipo AS STRING) tipo, | ||
SAFE_CAST(localExterno AS STRING) local_externo, | ||
SAFE_CAST(localCamara_nome AS STRING) nome_local, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.evento AS t |
9 changes: 9 additions & 0 deletions
9
models/br_camara_dados_abertos/br_camara_dados_abertos__evento_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,9 @@ | ||
{{ config(alias='evento_orgao',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
SAFE_CAST(idEvento AS STRING) id, | ||
SAFE_CAST(uriEvento AS STRING) url, | ||
SAFE_CAST(idOrgao AS STRING) id_orgao, | ||
SAFE_CAST(siglaOrgao AS STRING) sigla_orgao, | ||
SAFE_CAST(uriOrgao AS STRING) url_orgao, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.evento_orgao AS t | ||
|
11 changes: 11 additions & 0 deletions
11
models/br_camara_dados_abertos/br_camara_dados_abertos__evento_presenca_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,11 @@ | ||
{{ config(alias='evento_presenca_deputado',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
DISTINCT | ||
SAFE_CAST(idEvento AS STRING) id, | ||
SAFE_CAST(uriEvento AS STRING) url, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataHoraInicio)), 'T')[OFFSET(0)] AS DATE) data_inicio, | ||
SAFE_CAST(SPLIT(FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E*S', TIMESTAMP(dataHoraInicio)), 'T')[OFFSET(1)] AS TIME) horario_inicio, | ||
SAFE_CAST(idDeputado AS STRING) id_deputado, | ||
SAFE_CAST(uriDeputado AS STRING) url_deputado, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.evento_presenca_deputado AS t | ||
|
7 changes: 7 additions & 0 deletions
7
models/br_camara_dados_abertos/br_camara_dados_abertos__evento_requerimento.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,7 @@ | ||
{{ config(alias='evento_requerimento',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
SAFE_CAST(idEvento AS STRING) id, | ||
SAFE_CAST(uriEvento AS STRING) url, | ||
SAFE_CAST(tituloRequerimento AS STRING) titulo_requerimento, | ||
SAFE_CAST(uriRequerimento AS STRING) url_requerimento, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.evento_requerimento AS t |
20 changes: 20 additions & 0 deletions
20
models/br_camara_dados_abertos/br_camara_dados_abertos__frente.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,20 @@ | ||
{{ config(alias='frente',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
SAFE_CAST(id AS STRING) id, | ||
SAFE_CAST(uri AS STRING) url, | ||
SAFE_CAST(titulo AS STRING) titulo, | ||
SAFE_CAST(dataCriacao AS DATE) data_criacao, | ||
SAFE_CAST(idLegislatura AS STRING) id_legislatura, | ||
SAFE_CAST(telefone AS STRING) telefone, | ||
SAFE_CAST(situacao AS STRING) situacao, | ||
SAFE_CAST(urlDocumento AS STRING) url_documento, | ||
SAFE_CAST(coordenador_id AS STRING) id_coordenador, | ||
SAFE_CAST(coordenador_nome AS STRING) nome_coordenador, | ||
SAFE_CAST(coordenador_urlFoto AS STRING) url_foto_coordenador, | ||
SAFE_CAST(coordenador_uri AS STRING) url_coordenador, | ||
SAFE_CAST(coordenador_siglaUf AS STRING) sigla_uf_coordenador, | ||
SAFE_CAST(coordenador_idLegislatura AS STRING) id_legislatura_coordenador, | ||
SAFE_CAST(coordenador_siglaPartido AS STRING) sigla_partido_coordenador, | ||
SAFE_CAST(coordenador_uriPartido AS STRING) url_partido_coordenador, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.frente AS t | ||
|
14 changes: 14 additions & 0 deletions
14
models/br_camara_dados_abertos/br_camara_dados_abertos__frente_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='frente_deputado',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
SAFE_CAST(id AS STRING) id, | ||
SAFE_CAST(uri AS STRING) url, | ||
SAFE_CAST(titulo AS STRING) titulo, | ||
SAFE_CAST(id_deputado AS STRING) id_deputado, | ||
INITCAP(nome_deputado) nome_deputado, | ||
SAFE_CAST(titulo_deputado AS STRING) titulo_deputado, | ||
SAFE_CAST(sigla_uf_deputado AS STRING) sigla_uf_deputado, | ||
SAFE_CAST(url_deputado AS STRING) url_deputado, | ||
SAFE_CAST(url_partido_deputado AS STRING) url_partido_deputado, | ||
SAFE_CAST(id_legislatura_deputado AS STRING) id_legislatura_deputado, | ||
SAFE_CAST(url_foto_deputado AS STRING) url_foto_deputado, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.frente_deputado AS t |
15 changes: 15 additions & 0 deletions
15
models/br_camara_dados_abertos/br_camara_dados_abertos__funcionario.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='funcionario',schema='br_camara_dados_abertos') }} | ||
SELECT | ||
DISTINCT | ||
SAFE_CAST(nome AS STRING) nome, | ||
SAFE_CAST(cargo AS STRING) cargo, | ||
SAFE_CAST(funcao AS STRING) funcao, | ||
SAFE_CAST(dataInicioHistorico AS DATE) data_inicio_historico, | ||
SAFE_CAST(dataNomeacao AS DATE) data_nomeacao, | ||
SAFE_CAST(dataPubNomeacao AS DATE) data_publicacao_nomeacao, | ||
SAFE_CAST(grupo AS STRING) grupo, | ||
SAFE_CAST(ponto AS STRING) ponto, | ||
SAFE_CAST(atoNomeacao AS STRING) ato_nomeacao, | ||
SAFE_CAST(lotacao AS STRING) lotacao, | ||
SAFE_CAST(uriLotacao AS STRING) url_lotacao, | ||
FROM basedosdados-staging.br_camara_dados_abertos_staging.funcionario AS t |
Oops, something went wrong.