Skip to content

Commit

Permalink
fix: queries with new column names and types
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunodePauloAlmeida committed Oct 24, 2024
1 parent db445f5 commit 50ccd5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ SAFE_CAST(valor_de_referencia AS STRING) as valor_referencia,
SAFE_CAST(data_de_referencia AS STRING) as data_referencia,
SAFE_CAST(meta AS STRING) as meta,
SAFE_CAST(relacionada_a_meta_estrategica AS STRING) as relacao_estrategia,
SAFE_CAST(indicacao_para_auditoria_pela_cgm AS STRING) as indicacao_auditoria,
SAFE_CAST(unidade_de_medida AS STRING) as unidade_de_medida,
SAFE_CAST(gerencia AS STRING) as gerencia,
SAFE_CAST(chave_meta_ar AS STRING) as chave_meta,
SAFE_CAST(codigo_metaar AS STRING) as codigo_meta_ar,
SAFE_CAST(SAFE_CAST(ref_resultado AS FLOAT64) AS INT64) as referencia_resultado,
SAFE_CAST(resultado AS STRING) as resultado,
SAFE_CAST(SAFE_CAST(ref_chance_meta_desdobrada AS FLOAT64) AS INT64) as referencia_chance_meta_desdobrada,
SAFE_CAST(SAFE_CAST(ref_chance_meta_desdobrada AS FLOAT64) AS INT64) as referencia_chance_meta_desdobrada,
SAFE_CAST(SAFE_CAST(chance_meta_desdobrada AS FLOAT64) AS INT64) as chance_meta_desdobrada,
SAFE_CAST(SAFE_CAST(ref_resultado2_performance AS FLOAT64) AS INT64) as referencia_resultado_orgao_2,
SAFE_CAST(resultado2_performance AS STRING) as resultado_orgao_2,
Expand All @@ -34,20 +34,20 @@ SAFE_CAST(SAFE_CAST(cor_chance_meta AS FLOAT64) AS INT64) as chance_meta_orgao_1
SAFE_CAST(SAFE_CAST(cor_chance_meta_orgao_2 AS FLOAT64) AS INT64) as chance_meta_orgao_2,
CASE
WHEN resultado_performance_prefeito = "TRUE" THEN TRUE
WHEN resultado_performance_prefeito = "FALSE" THEN FALSE
WHEN resultado_performance_prefeito = "FALSE" THEN FALSE
WHEN resultado_performance_prefeito = "VERDADEIRO" THEN TRUE
WHEN resultado_performance_prefeito = "FALSO" THEN FALSE
WHEN resultado_performance_prefeito = "Sim" THEN TRUE
WHEN resultado_performance_prefeito = "Não" THEN FALSE
ELSE NULL
ELSE NULL
END as indicador_resultado_peformance_orgao_1,
CASE
WHEN resultado_performance2_prefeito = "TRUE" THEN TRUE
WHEN resultado_performance2_prefeito = "FALSE" THEN FALSE
WHEN resultado_performance2_prefeito = "FALSE" THEN FALSE
WHEN resultado_performance2_prefeito = "VERDADEIRO" THEN TRUE
WHEN resultado_performance2_prefeito = "FALSO" THEN FALSE
WHEN resultado_performance2_prefeito = "Sim" THEN TRUE
WHEN resultado_performance2_prefeito = "Não" THEN FALSE
ELSE NULL
ELSE NULL
END as indicador_resultado_peformance_orgao_2
FROM `rj-smfp.planejamento_gestao_acordo_resultados_staging.meta_desdobrada`
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
SELECT
SAFE_CAST(cod_recurso AS STRING) as id_recurso,
SAFE_CAST(SAFE_CAST(SAFE_CAST(cod_recurso AS FLOAT64) AS INT64) AS STRING) as id_recurso,
SAFE_CAST(ano_do_acordo_a_que_se_refere_o_recurso AS INT64) as ano,
SAFE_CAST(orgao_solicitante AS STRING) as orgao,
SAFE_CAST(cod_meta AS STRING) as codigo_meta,
SAFE_CAST(orgao_acordo_egpweb AS STRING) as orgao_egpweb,
SAFE_CAST(SAFE_CAST(SAFE_CAST(cod_meta AS FLOAT64) AS INT64) AS STRING) as codigo_meta,
SAFE_CAST(orgao_acordo_egpweb AS STRING) as orgao_egpweb,
SAFE_CAST(oficio AS STRING) as oficio,
SAFE_CAST(codigo_processorio AS STRING) as codigo_processorio,
SAFE_CAST(data_solicitacao AS DATE FORMAT 'DD/MM/YYYY') as data_solicitacao,
Expand Down

0 comments on commit 50ccd5e

Please sign in to comment.