-
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 'main' into staging/br_camara_deputados
- Loading branch information
Showing
13 changed files
with
347 additions
and
30 deletions.
There are no files selected for viewing
16 changes: 15 additions & 1 deletion
16
...racao/energia_armazenada_reservatorio.sql → ...acao__energia_armazenada_reservatorio.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
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
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
9 changes: 7 additions & 2 deletions
9
...r_ons_avaliacao_operacao/reservatorio.sql → ..._ons_avaliacao_operacao__reservatorio.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
39 changes: 39 additions & 0 deletions
39
...r_ons_avaliacao_operacao/br_ons_avaliacao_operacao__restricao_operacao_usinas_eolicas.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,39 @@ | ||
{{ config( | ||
alias='restricao_operacao_usinas_eolicas', | ||
schema='br_ons_avaliacao_operacao', | ||
materialized = 'incremental', | ||
partition_by={ | ||
"field": "ano", | ||
"data_type": "int64", | ||
"range": { | ||
"start": 2021, | ||
"end": 2024, | ||
"interval": 1} | ||
}) | ||
}} | ||
WITH ons as ( | ||
SELECT | ||
SAFE_CAST(data AS DATE) data, | ||
SAFE_CAST(hora AS TIME) hora, | ||
SAFE_CAST(ano AS INT64) ano, | ||
SAFE_CAST(mes AS INT64) mes, | ||
SAFE_CAST(sigla_uf AS STRING) sigla_uf, | ||
SAFE_CAST(id_subsistema AS STRING) id_subsistema, | ||
SAFE_CAST(subsistema AS STRING) subsistema, | ||
SAFE_CAST(id_ons AS STRING) id_ons, | ||
SAFE_CAST(REPLACE(id_empreendimento_aneel, '-', '') AS STRING) id_empreendimento_aneel, | ||
SAFE_CAST(usina AS STRING) usina, | ||
SAFE_CAST(REPLACE(tipo_razao_restricao, 'nan', '') AS STRING) tipo_razao_restricao, | ||
SAFE_CAST(REPLACE(tipo_origem_restricao, 'nan', '') AS STRING) tipo_origem_restricao, | ||
SAFE_CAST(geracao AS FLOAT64) geracao, | ||
SAFE_CAST(geracao_limitada AS FLOAT64) geracao_limitada, | ||
SAFE_CAST(disponibilidade AS FLOAT64) disponibilidade, | ||
SAFE_CAST(geracao_referencia AS FLOAT64) geracao_referencia, | ||
SAFE_CAST(geracao_referencia_final AS FLOAT64) geracao_referencia_final | ||
FROM basedosdados-staging.br_ons_avaliacao_operacao_staging.restricao_operacao_usinas_eolicas AS t | ||
) | ||
SELECT DISTINCT * | ||
FROM ons | ||
{% if is_incremental() %} | ||
WHERE data > (SELECT max(data) FROM {{ this }} ) | ||
{% endif %} |
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
7 changes: 7 additions & 0 deletions
7
...va_custos/balanco_energia_subsistemas.sql → ...a_custos__balanco_energia_subsistemas.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
9 changes: 9 additions & 0 deletions
9
...os/balanco_energia_subsistemas_dessem.sql → ...s__balanco_energia_subsistemas_dessem.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
6 changes: 6 additions & 0 deletions
6
...ustos/custo_marginal_operacao_semanal.sql → ...stos__custo_marginal_operacao_semanal.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
7 changes: 7 additions & 0 deletions
7
.../custo_marginal_operacao_semi_horario.sql → ..._custo_marginal_operacao_semi_horario.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
Oops, something went wrong.