Skip to content

Commit

Permalink
first casting to float before casting to int
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciacatandi committed Aug 16, 2024
1 parent d17d56f commit df04bde
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 41 deletions.
14 changes: 7 additions & 7 deletions queries/models/adm_licenca_urbanismo/alvara_obra_privada.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cod_dlf AS id_orgao_SISLIC,
CAST(Dt_emissao AS DATETIME) AS Data_emissao,
CAST(Dt_Inicio_Validade AS DATETIME) AS Data_Inicio_Validade,
CAST(dt_Venc AS DATETIME) AS Data_Vencimento,
CAST(Prazo AS int64) AS Prazo,
CAST(CAST(Prazo AS FLOAT64) AS int64) AS Prazo,
Num_darm_pg AS Numero_DARM_Pago,
CAST(l_Lic as float64) AS Valor_DARM,
Requerente AS Requerente,
Expand All @@ -32,7 +32,7 @@ InscricaoIMOVEL AS Inscricao_Imovel,
ID_TpInscricaoIMOVEL AS ID_Tipo_Inscricao_Imovel,
Uso_atividade AS Uso_Atividade,
Implantacao AS Implantacao,
CAST(tot_edif as int64) AS Total_Edificacoes,
CAST(CAST(tot_edif AS FLOAT64) as int64) AS Total_Edificacoes,
CAST(area_constr AS FLOAT64) AS Area_Construida,
CAST(area_acrescida AS FLOAT64) AS Area_Acrescida,
CAST(area_reduzida AS FLOAT64) AS Area_Reduzida,
Expand All @@ -41,9 +41,9 @@ CAST(AREA_TOTAL_EDIFICADA AS FLOAT64) AS Area_Total_Edificada,
CAST(AREA_EXISTENTE_DECLARADA_RESPONSAVEL AS FLOAT64) AS Area_Existente_Declarada_Responsavel,
CAST(AreaTotal_Loteamento AS FLOAT64) AS Area_Total_Loteamento,
CAST(MetrosLineares_ObrasUrbanizacao AS FLOAT64) AS Metros_Lineares_Obras_Urbanizacao,
CAST(VagasExternasDescobertas AS INT64) AS Vagas_Externas_Descobertas,
CAST(VagasExternasCobertas AS INT64) AS Vagas_Externas_Cobertas,
CAST(VagasPavimentos AS INT64) AS Vagas_Pavimentos,
CAST(CAST(VagasExternasDescobertas AS FLOAT64) AS INT64) AS Vagas_Externas_Descobertas,
CAST(CAST(VagasExternasCobertas AS FLOAT64) AS INT64) AS Vagas_Externas_Cobertas,
CAST(CAST(VagasPavimentos AS FLOAT64) AS INT64) AS Vagas_Pavimentos,
nome_preo AS Nome_PREO,
crea_preo AS CREA_PREO,
RRT_ART_PREO AS RRT_ART_PREO,
Expand All @@ -66,6 +66,6 @@ CAST(Licenca_Loteamento AS BOOL) AS Licenca_Loteamento,
CAST(LicencaAvulsa AS BOOL) AS Licenca_Avulsa,
CAST(LoteamentoNovoModelo AS BOOL) AS Loteamento_Novo_Modelo,
CAST(AprovacaoParcelamento AS BOOL) AS Aprovacao_Parcelamento,
CAST(Totalunidades AS INT64) AS Total_Unidades,
CAST(LicOnLine_ID_Requerimento AS INT64) AS ID_Requerimento_Licenca_OnLine
CAST(CAST(Totalunidades AS FLOAT64) AS INT64) AS Total_Unidades,
CAST(CAST(LicOnLine_ID_Requerimento AS FLOAT64) AS INT64) AS ID_Requerimento_Licenca_OnLine
FROM `rj-smdue.adm_licenca_urbanismo_staging.alvara_obra_privada`
6 changes: 3 additions & 3 deletions queries/models/adm_licenca_urbanismo/assunto_processo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SELECT
codAssunto AS id_assunto,
Status AS status,
codAssunto_ReqOnLine AS id_assunto_requerimento_online,
CAST(Exige_Endereco AS INT64) AS exige_endereco,
CAST(Exige_ProcessoConstrucao AS INT64) AS exige_processo_construcao,
CAST(Exige_CPF_CNPJ_Requerente AS INT64) AS exige_CPF_CNPJ_requerente,
CAST(CAST(Exige_Endereco AS FLOAT64) AS INT64) AS exige_endereco,
CAST(CAST(Exige_ProcessoConstrucao AS FLOAT64) AS INT64) AS exige_processo_construcao,
CAST(CAST(Exige_CPF_CNPJ_Requerente AS FLOAT64) AS INT64) AS exige_CPF_CNPJ_requerente,
AssuntoProcessoRio AS assunto_processo_rio
FROM `rj-smdue.adm_licenca_urbanismo_staging.assunto_processo`
2 changes: 1 addition & 1 deletion queries/models/adm_licenca_urbanismo/darm_alvara.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Cod_Receita AS Codigo_Receita ,
CAST(Dt_Emissao AS DATETIME) AS Data_Emissao ,
CAST(Dt_Venc AS DATETIME) AS Data_Vencimento ,
CAST(Dt_Pagamento AS DATETIME) AS Data_Pagamento ,
CAST(Competencia AS INT64) AS Competencia ,
CAST(CAST(Competencia AS FLOAT64) AS INT64) AS Competencia ,
CAST(Mora AS FLOAT64) AS Mora ,
CAST(Multa AS FLOAT64) AS Multa,
CAST(Valor_Darm_Inicial AS FLOAT64) AS Valor_Darm_Inicial ,
Expand Down
4 changes: 2 additions & 2 deletions queries/models/adm_licenca_urbanismo/documento.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ SELECT
id_classificacao_processo AS id_classificacao_processo,
id_origem_classificacao_processo AS id_origem_classificacao_processo,
id_tipo_processo AS id_tipo_processo,
CAST(ano_requerimento AS INT64) AS ano_requerimento,
CAST(numero_requerimento AS INT64) AS numero_requerimento
CAST(CAST(ano_requerimento AS FLOAT64) AS INT64) AS ano_requerimento,
CAST(CAST(numero_requerimento AS FLOAT64) AS INT64) AS numero_requerimento
FROM `rj-smdue.adm_licenca_urbanismo_staging.documento`
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ CAST(area_util AS FLOAT64) AS Area_Util ,
CAST(embasamento AS BOOL) AS Embasamento ,
CAST(RecebeNumeracao AS BOOL) AS Recebe_Numeracao ,
CAST(ContaEdificacao AS BOOL) AS Conta_Edificacao ,
CAST(Qtd_Edif AS INT64) AS Total_Edificacoes
CAST(CAST(Qtd_Edif AS FLOAT64) AS INT64) AS Total_Edificacoes
FROM `rj-smdue.adm_licenca_urbanismo_staging.edificacao_obra_licenca`
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ CAST(vfMunicipal AS BOOL) AS Endereco_Dentro_Municipio,
UF AS UF,
numPAA AS Numero_PAA,
CAST(dtCadastro AS DATETIME) AS Data_Cadastro,
CAST(matricCadastrador AS INT64) AS Matricula_Cadastrador,
CAST(CAST(matricCadastrador AS FLOAT64) AS INT64) AS Matricula_Cadastrador,
CEP AS CEP,
InscricaoIMOVEL AS Inscricao_Imovel,
CAST(ID_TpInscricaoIMOVEL AS INT64) AS ID_Tipo_Inscricao_Imovel
CAST(CAST(ID_TpInscricaoIMOVEL AS FLOAT64) AS INT64) AS ID_Tipo_Inscricao_Imovel
FROM `rj-smdue.adm_licenca_urbanismo_staging.endereco_produto_pedido`
2 changes: 1 addition & 1 deletion queries/models/adm_licenca_urbanismo/fase_obra.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SELECT
Cod_Fase AS id_fase,
Abrev_Fase AS nome_fase,
CAST(OrdemImp AS INT64) AS ordem_importancia
CAST(CAST(OrdemImp AS FLOAT64) AS INT64) AS ordem_importancia
FROM `rj-smdue.adm_licenca_urbanismo_staging.fase_obra`
6 changes: 3 additions & 3 deletions queries/models/adm_licenca_urbanismo/licenca_loteamento.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SELECT
CAST(Id_Lote AS string) AS id_lote ,
CAST(num_lic AS string) AS id_licenciamento,
CAST(Quantidade AS int) AS quantidade_lotes,
CAST(Categoria AS int) AS categoria_lote,
CAST(TpLote AS int) AS lote_aprovado
CAST(CAST(Quantidade AS FLOAT64) AS int64) AS quantidade_lotes,
CAST(CAST(Categoria AS FLOAT64) AS int64) AS categoria_lote,
CAST(CAST(TpLote AS FLOAT64) AS int64) AS lote_aprovado
FROM `rj-smdue.adm_licenca_urbanismo_staging.licenca_loteamento`
14 changes: 7 additions & 7 deletions queries/models/adm_licenca_urbanismo/loteamento_alvara.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ SELECT
num_lic AS Id_Licenciamento,
LotesVinculados AS Descricao_Lotes_Vinculados ,
CAST(ComprLograProjetados AS FLOAT64) AS Comprimento_Logradouros_Projetados,
CAST(TotalLotesPrimitivosRemembramento AS INT64) AS Total_Lotes_Primitivos_Remembramento,
CAST(TotalLotesRemembrados AS INT64) AS Total_Lotes_Remembrados ,
CAST(TotalLotesPrimitivosDesmembramento AS INT64) AS Total_Lotes_Primitivos_Desmembramento ,
CAST(TotalLotesDesmembrados AS INT64) AS Total_Lotes_Desmembrados,
CAST(TotalLotesPrimitivosReDesmembramento AS INT64) AS Total_Lotes_Primitivos_Remembramento_Desmembramento ,
CAST(TotalLotesReDesmembrados AS INT64) AS Total_Lotes_Remembramento_Desmembramento ,
CAST(TotalAreasPrivativasPrimitivas AS INT64) AS Total_Areas_Privativas_Primitivas ,
CAST(CAST(TotalLotesPrimitivosRemembramento AS FLOAT64) AS INT64) AS Total_Lotes_Primitivos_Remembramento,
CAST(CAST(TotalLotesRemembrados AS FLOAT64) AS INT64) AS Total_Lotes_Remembrados ,
CAST(CAST(TotalLotesPrimitivosDesmembramento AS FLOAT64) AS INT64) AS Total_Lotes_Primitivos_Desmembramento ,
CAST(CAST(TotalLotesDesmembrados AS FLOAT64) AS INT64) AS Total_Lotes_Desmembrados,
CAST(CAST(TotalLotesPrimitivosReDesmembramento AS FLOAT64) AS INT64) AS Total_Lotes_Primitivos_Remembramento_Desmembramento ,
CAST(CAST(TotalLotesReDesmembrados AS FLOAT64) AS INT64) AS Total_Lotes_Remembramento_Desmembramento ,
CAST(CAST(TotalAreasPrivativasPrimitivas AS FLOAT64) AS INT64) AS Total_Areas_Privativas_Primitivas ,
CAST(TotalAreasPrivativasResultantes AS FLOAT64) AS Total_Areas_Privativas_Resultantes
FROM `rj-smdue.adm_licenca_urbanismo_staging.loteamento_alvara`
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Id_Pav AS Id_Pavimento,
Num_lic AS Id_Licenciamento,
Id_Edif AS Id_Edificacao,
Pavimento AS Pavimento ,
CAST(Tot_pav AS INT64) AS Total_Pavimentos,
CAST(tot_vagasCobertas AS INT64) AS Total_Vagas_Cobertas,
CAST(Tot_VagasDescobertas AS INT64) AS Total_Vagas_Descobertas
CAST(CAST(Tot_pav AS FLOAT64) AS INT64) AS Total_Pavimentos,
CAST(CAST(tot_vagasCobertas AS FLOAT64) AS INT64) AS Total_Vagas_Cobertas,
CAST(CAST(Tot_VagasDescobertas AS FLOAT64) AS INT64) AS Total_Vagas_Descobertas
FROM `rj-smdue.adm_licenca_urbanismo_staging.pavimento_edificacao_obra`
2 changes: 1 addition & 1 deletion queries/models/adm_licenca_urbanismo/prpa.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ SELECT
NUMERO_REGISTRO_PRPA AS Numero_Registro_PRPA,
TIPO_CONSELHO_PRPA AS Tipo_Conselho_PRPA,
NUMERO_CONSELHO_PRPA AS Numero_Conselho_PRPA,
CAST(ID_PROFISSAO AS INT64) AS Id_Profissao
CAST(CAST(ID_PROFISSAO AS FLOAT64) AS INT64) AS Id_Profissao
FROM `rj-smdue.adm_licenca_urbanismo_staging.prpa`
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ identidade AS identidade_requerente,
emissor AS emissor_identidade,
cep AS cep,
CAST(dtCadastro AS DATETIME) AS data_cadastro,
CAST(matricCadastrador AS INT64) AS matricula_cadastrador,
CAST(CAST(matricCadastrador AS FLOAT64) AS INT64) AS matricula_cadastrador,
Bairro AS bairro,
UF AS uf,
CAST(codLogra AS INT64) AS id_logradouro,
CAST(CAST(codLogra AS FLOAT64) AS INT64) AS id_logradouro,
descLogra AS nome_logradouro_fora,
numero AS numero,
compend AS complememto_endereco,
Expand Down
6 changes: 3 additions & 3 deletions queries/models/adm_licenca_urbanismo/restricao_alvara.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SELECT
CAST(Id_Rest AS int64 ) AS Id_Restricao,
CAST(num_lic AS INT64) AS Id_Licenciamento,
CAST(cod_Restricao AS INT64) AS Id_Tipo_Restricao,
CAST(CAST(Id_Rest AS FLOAT64) AS int64 ) AS Id_Restricao,
CAST(CAST(num_lic AS FLOAT64) AS INT64) AS Id_Licenciamento,
CAST(CAST(cod_Restricao AS FLOAT64) AS INT64) AS Id_Tipo_Restricao,
CAST(Compl_Restricao AS string) AS Compl_Tipo_Restricao ,
CAST(Outra_restricao AS string) AS Outra_restricao ,
CAST(Data_Baixa AS datetime) AS Data_Baixa ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
tipo_licenca_acao_requerente`
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SELECT
codParecer AS Id_Parecer,
descParecer AS Descricao_Parecer,
CAST(vfGeraPublicacao as int64) AS Gera_Publicacao,
CAST(CAST(vfGeraPublicacao AS FLOAT64) as int64) AS Gera_Publicacao,
descClassificacao AS Classificacao,
cast(PUBLICACAO_FRENTE_DO as bool) AS Publicacao_Frente_DO
FROM `rj-smdue.adm_licenca_urbanismo_staging.tipo_parecer_tramite`
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ id_edif AS Id_Edificacao,
id_SubDivisao AS id_SubDivisao,
cod_unidade AS Id_Tipo_Unidade,
ComplTipo_Unid AS Descricao_Tipo_Unidade ,
CAST(quant_unid AS INT64) AS Quantidade_Unidades ,
CAST(CAST(quant_unid AS FLOAT64) AS INT64) AS Quantidade_Unidades ,
Num_recebida AS Identificacao_Unidade ,
CAST(area_unid AS FLOAT64) AS Area_Unidades
FROM `rj-smdue.adm_licenca_urbanismo_staging.unidade_edificacao_obra`
4 changes: 2 additions & 2 deletions queries/models/adm_licenca_urbanismo/unidade_habite_se.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ SELECT
ID AS id_unidades_habite_se,
Num_Hab AS id_habite_se,
Id_edif AS id_edificacao,
CAST(Quant_Edif AS INT64) AS quantidade_edificacoes,
CAST(CAST(Quant_Edif AS FLOAT64) AS INT64) AS quantidade_edificacoes,
Cod_Unidade AS id_unidade,
CAST(Quant_Unidade AS INT64) AS quantidade_unidades,
CAST(CAST(Quant_Unidade AS FLOAT64) AS INT64) AS quantidade_unidades,
CAST(Area AS FLOAT64) AS area
FROM `rj-smdue.adm_licenca_urbanismo_staging.unidade_habite_se`

0 comments on commit df04bde

Please sign in to comment.