Skip to content

Commit

Permalink
fix: missing comma
Browse files Browse the repository at this point in the history
  • Loading branch information
d116626 committed Jan 12, 2024
1 parent bd2ca04 commit fd4a5b2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
20 changes: 10 additions & 10 deletions queries/models/recursos_humanos_ergon/ficha_financeira.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
}}

SELECT
SAFE_CAST(DATE(mes_ano_folha) AS DATE) AS data_folha,
SAFE_CAST(REGEXP_REPLACE(TRIM(num_folha), r'\.0$', '') AS INT64) AS numero_folha,
SAFE_CAST(REGEXP_REPLACE(TRIM(numfunc), r'\.0$', '') AS STRING) AS id_funcionario,
SAFE_CAST(REGEXP_REPLACE(TRIM(numvinc), r'\.0$', '') AS STRING) AS id_vinculo,
SAFE_CAST(REGEXP_REPLACE(TRIM(numpens), r'\.0$', '') AS INT64) AS numero_pensionista,
SAFE_CAST(TRIM(mes_ano_direito) AS STRING) AS data_pagamento,
SAFE_CAST(DATE(mes_ano_folha) AS DATE) AS mes_ano_folha,
SAFE_CAST(REGEXP_REPLACE(TRIM(num_folha), r'\.0$', '') AS INT64) AS num_folha,
SAFE_CAST(REGEXP_REPLACE(TRIM(numfunc), r'\.0$', '') AS STRING) AS numfunc,
SAFE_CAST(REGEXP_REPLACE(TRIM(numvinc), r'\.0$', '') AS STRING) AS numvinc,
SAFE_CAST(REGEXP_REPLACE(TRIM(numpens), r'\.0$', '') AS INT64) AS numpens,
SAFE_CAST(TRIM(mes_ano_direito) AS STRING) AS mes_ano_direito,
SAFE_CAST(TRIM(rubrica) AS STRING) AS rubrica,
SAFE_CAST(TRIM(tipo_rubrica) AS STRING) AS tipo_rubrica,
SAFE_CAST(TRIM(desc_vant) AS STRING) AS desconto,
SAFE_CAST(TRIM(complemento) AS STRING) AS complemento_rubrica,
SAFE_CAST(REGEXP_REPLACE(valor, r',', '.') AS FLOAT64) AS valor_rubrica,
SAFE_CAST(TRIM(desc_vant) AS STRING) AS desc_vant,
SAFE_CAST(TRIM(complemento) AS STRING) AS complemento,
SAFE_CAST(REGEXP_REPLACE(valor, r',', '.') AS FLOAT64) AS valor,
SAFE_CAST(REGEXP_REPLACE(correcao, r',', '.') AS FLOAT64) AS correcao,
SAFE_CAST(REGEXP_REPLACE(TRIM(emp_codigo), r'\.0$', '') AS STRING) AS id_empresa,
SAFE_CAST(REGEXP_REPLACE(TRIM(emp_codigo), r'\.0$', '') AS STRING) AS emp_codigo,
SAFE_CAST(data_particao AS DATE) data_particao,
FROM rj-smfp.recursos_humanos_ergon_staging.ficha_financeira AS t
WHERE
Expand Down
46 changes: 23 additions & 23 deletions queries/models/recursos_humanos_ergon/fita_banco.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@
)
}}
SELECT
SAFE_CAST(REGEXP_REPLACE(lancamento, r'\.0$', '') AS STRING) AS id_lancamento,
SAFE_CAST(mes_ano AS DATE) AS data_folha,
SAFE_CAST(dtexerc AS DATE) AS data_exercicio,
SAFE_CAST(dtaposent AS DATE) AS data_aposentadoria,
SAFE_CAST(dtvac AS DATE) AS data_vacancia,
SAFE_CAST(REGEXP_REPLACE(lancamento, r'\.0$', '') AS STRING) AS lancamento,
SAFE_CAST(mes_ano AS DATE) AS mes_ano,
SAFE_CAST(dtexerc AS DATE) AS dtexerc,
SAFE_CAST(dtaposent AS DATE) AS dtaposent,
SAFE_CAST(dtvac AS DATE) AS dtvac,
SAFE_CAST(data_credito AS DATE) AS data_credito,
SAFE_CAST(REGEXP_REPLACE(numfunc, r'\.0$', '') AS STRING) AS id_funcao,
SAFE_CAST(REGEXP_REPLACE(numvinc, r'\.0$', '') AS STRING) AS id_vinculo,
SAFE_CAST(REGEXP_REPLACE(numero, r'\.0$', '') AS INT64) AS numero_folha,
SAFE_CAST(REGEXP_REPLACE(numfunc, r'\.0$', '') AS STRING) AS numfunc,
SAFE_CAST(REGEXP_REPLACE(numvinc, r'\.0$', '') AS STRING) AS numvinc,
SAFE_CAST(REGEXP_REPLACE(numero, r'\.0$', '') AS INT64) AS numero,
SAFE_CAST(rubrica AS STRING) AS rubrica,
SAFE_CAST(setor AS STRING) AS setor,
SAFE_CAST(REGEXP_REPLACE(valorvan, r',', '.') AS FLOAT64) AS valor_bruto,
SAFE_CAST(REGEXP_REPLACE(valordes, r',', '.') AS FLOAT64) AS valor_descontos,
SAFE_CAST(REGEXP_REPLACE(valorliq, r'\.0$', '') AS FLOAT64) AS valor_liquido,
SAFE_CAST(REGEXP_REPLACE(numpens, r'\.0$', '') AS INT64) AS pensionistas,
SAFE_CAST(REGEXP_REPLACE(numdepen, r'\.0$', '') AS INT64) AS dependente,
SAFE_CAST(REGEXP_REPLACE(agencia, r'\.0$', '') AS INT64) AS agencia_banco,
SAFE_CAST(REGEXP_REPLACE(valorvan, r',', '.') AS FLOAT64) AS valorvan,
SAFE_CAST(REGEXP_REPLACE(valordes, r',', '.') AS FLOAT64) AS valordes,
SAFE_CAST(REGEXP_REPLACE(valorliq, r'\.0$', '') AS FLOAT64) AS valorliq,
SAFE_CAST(REGEXP_REPLACE(numpens, r'\.0$', '') AS INT64) AS numpens,
SAFE_CAST(REGEXP_REPLACE(numdepen, r'\.0$', '') AS INT64) AS numdepen,
SAFE_CAST(REGEXP_REPLACE(agencia, r'\.0$', '') AS INT64) AS agencia,
SAFE_CAST(REGEXP_REPLACE(banco, r'\.0$', '') AS INT64) AS banco,
SAFE_CAST(REGEXP_REPLACE(conta, r'\.0$', '') AS INT64) AS conta_banco,
SAFE_CAST(REGEXP_REPLACE(cargo, r'\.0$', '') AS STRING) AS cargo,
SAFE_CAST(subcategoria AS STRING) AS cargo_subcategoria,
SAFE_CAST(REGEXP_REPLACE(referencia, r'\.0$', '') AS STRING) AS id_referencia,
SAFE_CAST(subcategoria AS STRING) AS subcategoria,
SAFE_CAST(REGEXP_REPLACE(referencia, r'\.0$', '') AS STRING) AS referencia,
SAFE_CAST(funcao AS STRING) AS funcao,
SAFE_CAST(nome AS STRING) AS nome_fita_banco,
SAFE_CAST(REGEXP_REPLACE(emp_codigo, r'\.0$', '') AS STRING) AS id_empresa,
SAFE_CAST(REGEXP_REPLACE(ficha, r'\.0$', '') AS STRING) AS id_ficha,
SAFE_CAST(REGEXP_REPLACE(regimejur, r'\.0$', '') AS STRING) AS regime_juridico,
SAFE_CAST(tipovinc AS STRING) AS tipo_vinculo,
SAFE_CAST(nome AS STRING) AS nome,
SAFE_CAST(REGEXP_REPLACE(emp_codigo, r'\.0$', '') AS STRING) AS emp_codigo,
SAFE_CAST(REGEXP_REPLACE(ficha, r'\.0$', '') AS STRING) AS ficha,
SAFE_CAST(REGEXP_REPLACE(regimejur, r'\.0$', '') AS STRING) AS regimejur,
SAFE_CAST(tipovinc AS STRING) AS tipovinc,
SAFE_CAST(categoria AS STRING) AS categoria,
SAFE_CAST(cpf AS STRING) AS cpf,
SAFE_CAST(REGEXP_REPLACE(flex_campo_05, r'\.0$', '') AS STRING) AS id_lotacao,
SAFE_CAST(REGEXP_REPLACE(jornada, r'\.0$', '') AS STRING) AS id_jornada,
SAFE_CAST(REGEXP_REPLACE(flex_campo_05, r'\.0$', '') AS STRING) AS flex_campo_05,
SAFE_CAST(REGEXP_REPLACE(jornada, r'\.0$', '') AS STRING) AS jornada,
SAFE_CAST(data_particao AS DATE) data_particao,
FROM rj-smfp.recursos_humanos_ergon_staging.fita_banco AS t
WHERE
Expand Down

0 comments on commit fd4a5b2

Please sign in to comment.