Commits

tbrugz committed ee232cd Draft

transf: tse_candidatos: dt_nascimento agora como timestamp ; + alts docs

Comments (0)

Files changed (3)

 pré-requisitos
 --------------
 
-- [kettle](http://kettle.pentaho.com/)
+- engine ETL [kettle](http://kettle.pentaho.com/) (versão [4.3](http://wiki.pentaho.com/display/BAD/Downloads))
 - banco de dados compatível com JDBC. testado com [h2](http://www.h2database.com/) (padrão, baixado pelo ivy) e [postgresql](http://www.postgresql.org/)
 - [ant](http://ant.apache.org/) e [ivy](http://ant.apache.org/ivy/) (recomendado)
 - engine OLAP compatível com mondrian (tipo [pentaho BI platform](http://community.pentaho.com/projects/bi_platform/) ou [saiku](http://analytical-labs.com/)) (desejável)
 passo-a-passo
 -------------
 
+configuração do ambiente:
+
 - baixar dados do [repositorio-de-dados-eleitorais](http://www.tse.jus.br/eleicoes/repositorio-de-dados-eleitorais) para `<project-dir>/dados/repositorio-de-dados-eleitorais/2010` e descompactar para o estado (UF) desejado (ver `/dados/README.md`)
 - copiar propriedades de `kettle.template.properties` para `<user-home>/.kettle/kettle.properties` (editando as propriedades necessárias)
-- editar `build.properties` (em especial `kettle.home`, `dadostse.carga.uf` e `dadostse.h2.basedir`)
+- editar `build.properties` (em especial as propriedades `kettle.home`, `dadostse.carga.uf` e `dadostse.h2.basedir`)
 - `ant resolve` - baixa dependências do projeto (inclusive banco H2)
 - `ant start-db` - inicia banco H2 (banco será criado na pasta apontada por `dadostse.h2.basedir` no arquivo `build.properties`)
 - `ant create-db-objects` - cria objetos de banco
-- `ant run-job-linux` ou `ant run-job-windows` ou `ant run-job-java` - carrega dados no banco
+
+carga de dados:
+
+- editar as propriedades `dadostse.carga.uf` e `dadostse.carga.anoeleicao` do `build.properties` para carregar os arquivos desejados 
+- `ant run-job-<*>` - carrega dados no banco:
+	- `run-job-java-basicos` - carrega dados básicos/genéricos (devem ser carregados apenas uma vez, e antes de outras cargas)
+	- `run-job-java-uf` - executa job de candidatos e votaçães (parametros: *ano* e *uf*)
+	- `run-job-java-uf-cand` - carrega somente dados de candidatos e bens de candidatos (parametros: *ano* e *uf*)
 
 para consultar o banco H2:
 
 créditos e licença
 ------------------
 
-autor: *Telmo Brugnara* <[tbrugz@gmail.com](mailto:tbrugz@gmail.com)>
+autor: Telmo Brugnara <[tbrugz@gmail.com](mailto:tbrugz@gmail.com)>
 
 licença: [AGPLv3](http://www.gnu.org/licenses/agpl.html)

kettle/repositorio-de-dados-eleitorais/origem_LISTACAND.ktr

   <order>
   <hop> <from>Filter rows</from><to>Dummy (do nothing)</to><enabled>Y</enabled> </hop>  <hop> <from>renames</from><to>Database lookup</to><enabled>Y</enabled> </hop>  <hop> <from>Database lookup</from><to>Filter rows</to><enabled>Y</enabled> </hop>  <hop> <from>Select values</from><to>I&#47;U - tse_candidatos</to><enabled>Y</enabled> </hop>  <hop> <from>I&#47;U - tse_candidatos</from><to>Erros - I&#47;U</to><enabled>Y</enabled> </hop>  <hop> <from>Filter rows</from><to>id_partido &#47; id_candidato</to><enabled>Y</enabled> </hop>  <hop> <from>id_partido &#47; id_candidato</from><to>Select values</to><enabled>Y</enabled> </hop>  <hop> <from>csv</from><to>renames</to><enabled>Y</enabled> </hop>  </order>
   <step>
-    <name>CSV - lista cand</name>
-    <type>CsvInput</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <filename>${dadostse.datadir}&#47;repositorio-de-dados-eleitorais&#47;${dadostse.carga.anoeleicao}&#47;consulta_cand_${dadostse.carga.anoeleicao}_${dadostse.carga.uf}.txt</filename>
-    <filename_field/>
-    <rownum_field/>
-    <include_filename>N</include_filename>
-    <separator>;</separator>
-    <enclosure>&quot;</enclosure>
-    <header>N</header>
-    <buffer_size>1000</buffer_size>
-    <lazy_conversion>N</lazy_conversion>
-    <add_filename_result>N</add_filename_result>
-    <parallel>N</parallel>
-    <newline_possible>N</newline_possible>
-    <encoding/>
-    <fields>
-      <field>
-        <name>DATA_GERACAO</name>
-        <type>Date</type>
-        <format>dd&#47;MM&#47;yyyy</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>-1</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>HORA_GERACAO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>10</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>ANO_ELEICAO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>4</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NUM_TURNO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>1</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_ELEICAO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>30</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>SIGLA_UF</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>2</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>SIGLA_UE</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>2</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_UE</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>30</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>CODIGO_CARGO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>2</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_CARGO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>30</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NOME_CANDIDATO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>SEQUENCIAL_CANDIDATO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NUMERO_CANDIDATO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>5</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NOME_URNA_CANDIDATO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>COD_SITUACAO_CANDIDATURA</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>2</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DES_SITUACAO_CANDIDATURA</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NUMERO_PARTIDO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>2</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>SIGLA_PARTIDO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>20</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NOME_PARTIDO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>CODIGO_LEGENDA</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>SIGLA_LEGENDA</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>4</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>COMPOSICAO_LEGENDA</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NOME_LEGENDA</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>CODIGO_OCUPACAO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_OCUPACAO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DATA_NASCIMENTO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>9</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NUM_TITULO_ELEITORAL_CANDIDATO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>IDADE_DATA_ELEICAO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>3</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>CODIGO_SEXO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>2</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_SEXO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>COD_GRAU_INSTRUCAO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_GRAU_INSTRUCAO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>40</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>CODIGO_ESTADO_CIVIL</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_ESTADO_CIVIL</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>40</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>CODIGO_NACIONALIDADE</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESCRICAO_NACIONALIDADE</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>40</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>SIGLA_UF_NASCIMENTO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>2</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>CODIGO_MUNICIPIO_NASCIMENTO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>6</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NOME_MUNICIPIO_NASCIMENTO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESPESA_MAX_CAMPANHA</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>15</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>COD_SIT_TOT_TURNO</name>
-        <type>Integer</type>
-        <format>#</format>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>4</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>DESC_SIT_TOT_TURNO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>100</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-    </fields>
-     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>78</xloc>
-      <yloc>153</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
     <name>Database lookup</name>
     <type>DBLookup</type>
     <description/>
     </step>
 
   <step>
-    <name>id_partido &#47; id_candidato</name>
-    <type>ScriptValueMod</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <compatible>N</compatible>
-    <optimizationLevel/>
-    <jsScripts>      <jsScript>        <jsScript_type>0</jsScript_type>
-        <jsScript_name>Script 1</jsScript_name>
-        <jsScript_script>&#47;&#47;Script here
-
-var ID_PARTIDO = &apos;&apos;
-	+ANO_ELEICAO
-	+SIGLA_UE
-	+lpad(NR_PARTIDO,&apos;0&apos;,2)
-	;
-
-var ID_CANDIDATO = &apos;&apos;
-	+ANO_ELEICAO
-	+SIGLA_UE
-	+lpad(CD_CARGO,&apos;0&apos;,2)
-	+lpad(NR_CANDIDATO,&apos;0&apos;,5)
-	;
-
-var ID_UE = &apos;&apos;
-	+ANO_ELEICAO
-	+SIGLA_UE
-
-var VALIDO = &apos;S&apos;;</jsScript_script>
-      </jsScript>    </jsScripts>    <fields>      <field>        <name>ID_PARTIDO</name>
-        <rename>ID_PARTIDO</rename>
-        <type>String</type>
-        <length>12</length>
-        <precision>0</precision>
-        <replace>N</replace>
-      </field>      <field>        <name>ID_CANDIDATO</name>
-        <rename>ID_CANDIDATO</rename>
-        <type>String</type>
-        <length>20</length>
-        <precision>-1</precision>
-        <replace>N</replace>
-      </field>      <field>        <name>ID_UE</name>
-        <rename>ID_UE</rename>
-        <type>String</type>
-        <length>10</length>
-        <precision>-1</precision>
-        <replace>N</replace>
-      </field>      <field>        <name>VALIDO</name>
-        <rename>VALIDO</rename>
-        <type>String</type>
-        <length>1</length>
-        <precision>-1</precision>
-        <replace>N</replace>
-      </field>    </fields>     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>340</xloc>
-      <yloc>292</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
-    <name>renames</name>
-    <type>SelectValues</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <fields>      <field>        <name>DATA_GERACAO</name>
-        <rename>DT_GERACAO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>HORA_GERACAO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>ANO_ELEICAO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NUM_TURNO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_ELEICAO</name>
-        <rename>DS_ELEICAO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_UF</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_UE</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_UE</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>CODIGO_CARGO</name>
-        <rename>CD_CARGO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_CARGO</name>
-        <rename>DS_CARGO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NOME_CANDIDATO</name>
-        <rename>NM_CANDIDATO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SEQUENCIAL_CANDIDATO</name>
-        <rename>SEQ_CANDIDATO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NUMERO_CANDIDATO</name>
-        <rename>NR_CANDIDATO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NOME_URNA_CANDIDATO</name>
-        <rename>NM_CANDIDATO_URNA</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>COD_SITUACAO_CANDIDATURA</name>
-        <rename>CD_SITUACAO_CANDIDATO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DES_SITUACAO_CANDIDATURA</name>
-        <rename>DS_SITUACAO_CANDIDATO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NUMERO_PARTIDO</name>
-        <rename>NR_PARTIDO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_PARTIDO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NOME_PARTIDO</name>
-        <rename>NM_PARTIDO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>CODIGO_LEGENDA</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_LEGENDA</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>COMPOSICAO_LEGENDA</name>
-        <rename>DS_LEGENDA</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NOME_LEGENDA</name>
-        <rename>NM_LEGENDA</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>CODIGO_OCUPACAO</name>
-        <rename>CD_OCUPACAO_CANDIDATO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_OCUPACAO</name>
-        <rename>DS_OCUPACAO_CANDIDATO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DATA_NASCIMENTO</name>
-        <rename>DT_NASCIMENTO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NUM_TITULO_ELEITORAL_CANDIDATO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>IDADE_DATA_ELEICAO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>CODIGO_SEXO</name>
-        <rename>CD_SEXO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_SEXO</name>
-        <rename>DS_SEXO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>COD_GRAU_INSTRUCAO</name>
-        <rename>CD_GRAU_INSTRUCAO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_GRAU_INSTRUCAO</name>
-        <rename>DS_GRAU_INSTRUCAO</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>CODIGO_ESTADO_CIVIL</name>
-        <rename>CD_ESTADO_CIVIL</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_ESTADO_CIVIL</name>
-        <rename>DS_ESTADO_CIVIL</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>CODIGO_NACIONALIDADE</name>
-        <rename>CD_NACIONALIDADE</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESCRICAO_NACIONALIDADE</name>
-        <rename>DS_NACIONALIDADE</rename>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_UF_NASCIMENTO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>CODIGO_MUNICIPIO_NASCIMENTO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NOME_MUNICIPIO_NASCIMENTO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESPESA_MAX_CAMPANHA</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>COD_SIT_TOT_TURNO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DESC_SIT_TOT_TURNO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>        <select_unspecified>N</select_unspecified>
-    </fields>     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>180</xloc>
-      <yloc>213</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
     <name>csv</name>
     <type>TextFileInput</type>
     <description/>
       </field>
       <field>
         <name>DATA_NASCIMENTO</name>
-        <type>String</type>
-        <format/>
+        <type>Date</type>
+        <format>dd-MMM-yy</format>
         <currency>,</currency>
         <decimal>.</decimal>
         <group>none</group>
     <line_number_files_destination_directory/>
     <line_number_files_extension>line</line_number_files_extension>
     <date_format_lenient>Y</date_format_lenient>
-    <date_format_locale>pt_BR</date_format_locale>
+    <date_format_locale>en</date_format_locale>
     <shortFileFieldName/>
     <pathFieldName/>
     <hiddenFieldName/>
       </GUI>
     </step>
 
+  <step>
+    <name>id_partido &#47; id_candidato</name>
+    <type>ScriptValueMod</type>
+    <description/>
+    <distribute>Y</distribute>
+    <copies>1</copies>
+         <partitioning>
+           <method>none</method>
+           <schema_name/>
+           </partitioning>
+    <compatible>N</compatible>
+    <optimizationLevel/>
+    <jsScripts>      <jsScript>        <jsScript_type>0</jsScript_type>
+        <jsScript_name>Script 1</jsScript_name>
+        <jsScript_script>&#47;&#47;Script here
+
+var ID_PARTIDO = &apos;&apos;
+	+ANO_ELEICAO
+	+SIGLA_UE
+	+lpad(NR_PARTIDO,&apos;0&apos;,2)
+	;
+
+var ID_CANDIDATO = &apos;&apos;
+	+ANO_ELEICAO
+	+SIGLA_UE
+	+lpad(CD_CARGO,&apos;0&apos;,2)
+	+lpad(NR_CANDIDATO,&apos;0&apos;,5)
+	;
+
+var ID_UE = &apos;&apos;
+	+ANO_ELEICAO
+	+SIGLA_UE
+
+var VALIDO = &apos;S&apos;;</jsScript_script>
+      </jsScript>    </jsScripts>    <fields>      <field>        <name>ID_PARTIDO</name>
+        <rename>ID_PARTIDO</rename>
+        <type>String</type>
+        <length>12</length>
+        <precision>0</precision>
+        <replace>N</replace>
+      </field>      <field>        <name>ID_CANDIDATO</name>
+        <rename>ID_CANDIDATO</rename>
+        <type>String</type>
+        <length>20</length>
+        <precision>-1</precision>
+        <replace>N</replace>
+      </field>      <field>        <name>ID_UE</name>
+        <rename>ID_UE</rename>
+        <type>String</type>
+        <length>10</length>
+        <precision>-1</precision>
+        <replace>N</replace>
+      </field>      <field>        <name>VALIDO</name>
+        <rename>VALIDO</rename>
+        <type>String</type>
+        <length>1</length>
+        <precision>-1</precision>
+        <replace>N</replace>
+      </field>    </fields>     <cluster_schema/>
+ <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
+      <xloc>340</xloc>
+      <yloc>292</yloc>
+      <draw>Y</draw>
+      </GUI>
+    </step>
+
+  <step>
+    <name>renames</name>
+    <type>SelectValues</type>
+    <description/>
+    <distribute>Y</distribute>
+    <copies>1</copies>
+         <partitioning>
+           <method>none</method>
+           <schema_name/>
+           </partitioning>
+    <fields>      <field>        <name>DATA_GERACAO</name>
+        <rename>DT_GERACAO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>HORA_GERACAO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>ANO_ELEICAO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NUM_TURNO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_ELEICAO</name>
+        <rename>DS_ELEICAO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>SIGLA_UF</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>SIGLA_UE</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_UE</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>CODIGO_CARGO</name>
+        <rename>CD_CARGO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_CARGO</name>
+        <rename>DS_CARGO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NOME_CANDIDATO</name>
+        <rename>NM_CANDIDATO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>SEQUENCIAL_CANDIDATO</name>
+        <rename>SEQ_CANDIDATO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NUMERO_CANDIDATO</name>
+        <rename>NR_CANDIDATO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NOME_URNA_CANDIDATO</name>
+        <rename>NM_CANDIDATO_URNA</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>COD_SITUACAO_CANDIDATURA</name>
+        <rename>CD_SITUACAO_CANDIDATO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DES_SITUACAO_CANDIDATURA</name>
+        <rename>DS_SITUACAO_CANDIDATO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NUMERO_PARTIDO</name>
+        <rename>NR_PARTIDO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>SIGLA_PARTIDO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NOME_PARTIDO</name>
+        <rename>NM_PARTIDO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>CODIGO_LEGENDA</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>SIGLA_LEGENDA</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>COMPOSICAO_LEGENDA</name>
+        <rename>DS_LEGENDA</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NOME_LEGENDA</name>
+        <rename>NM_LEGENDA</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>CODIGO_OCUPACAO</name>
+        <rename>CD_OCUPACAO_CANDIDATO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_OCUPACAO</name>
+        <rename>DS_OCUPACAO_CANDIDATO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DATA_NASCIMENTO</name>
+        <rename>DT_NASCIMENTO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NUM_TITULO_ELEITORAL_CANDIDATO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>IDADE_DATA_ELEICAO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>CODIGO_SEXO</name>
+        <rename>CD_SEXO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_SEXO</name>
+        <rename>DS_SEXO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>COD_GRAU_INSTRUCAO</name>
+        <rename>CD_GRAU_INSTRUCAO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_GRAU_INSTRUCAO</name>
+        <rename>DS_GRAU_INSTRUCAO</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>CODIGO_ESTADO_CIVIL</name>
+        <rename>CD_ESTADO_CIVIL</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_ESTADO_CIVIL</name>
+        <rename>DS_ESTADO_CIVIL</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>CODIGO_NACIONALIDADE</name>
+        <rename>CD_NACIONALIDADE</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESCRICAO_NACIONALIDADE</name>
+        <rename>DS_NACIONALIDADE</rename>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>SIGLA_UF_NASCIMENTO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>CODIGO_MUNICIPIO_NASCIMENTO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>NOME_MUNICIPIO_NASCIMENTO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESPESA_MAX_CAMPANHA</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>COD_SIT_TOT_TURNO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>      <field>        <name>DESC_SIT_TOT_TURNO</name>
+        <rename/>
+        <length>-2</length>
+        <precision>-2</precision>
+      </field>        <select_unspecified>N</select_unspecified>
+    </fields>     <cluster_schema/>
+ <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
+      <xloc>180</xloc>
+      <yloc>213</yloc>
+      <draw>Y</draw>
+      </GUI>
+    </step>
+
   <step_error_handling>
       <error>
         <source_step>I&#47;U - tse_candidatos</source_step>

modelo/TABLEs.sql

 	ds_legenda varchar(400),
 	cd_ocupacao_candidato bigint(19),
 	ds_ocupacao_candidato varchar(100),
-	dt_nascimento varchar(9),
+	dt_nascimento_str varchar(9),
 	idade smallint,
 	cd_sexo smallint,
 	ds_sexo varchar(15),
 	sigla_ue varchar(5),
 	id_ue varchar(10),
 	valido varchar(1),
+	dt_nascimento timestamp,
 	constraint tse_candidatos_pk primary key (id_candidato),
 	constraint tse_candidatos_uk1 UNIQUE (seq_candidato)
 );