Commits

tbrugz committed 625cce4 Draft

docs: adicionados comentários ; modelo: add FK ; + cleanup

Comments (0)

Files changed (5)

 x bens_cand: dimension (table!) lookup/update
 ? bens_cand: candidato inexistente (erro FK). parece erro na origem dos dados (candidato (ainda) nao cadastrado?)
 
+- erros FK! cand_partido_fk, candidatos_bens_fk
+- candidato.tipo: valido, legenda, invalido
 
 tech/serviços
 -------------

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

       <bordercolorblue>100</bordercolorblue>
       <drawshadow>Y</drawshadow>
     </notepad>
+    <notepad>
+      <note>carregar tipos_bens em transformação anterior
+se houver FK (h2: Timeout trying to lock table TSE_TIPOS_BENS)</note>
+      <xloc>481</xloc>
+      <yloc>324</yloc>
+      <width>334</width>
+      <heigth>35</heigth>
+      <fontname>Microsoft Sans Serif</fontname>
+      <fontsize>8</fontsize>
+      <fontbold>N</fontbold>
+      <fontitalic>N</fontitalic>
+      <fontcolorred>0</fontcolorred>
+      <fontcolorgreen>0</fontcolorgreen>
+      <fontcolorblue>0</fontcolorblue>
+      <backgroundcolorred>255</backgroundcolorred>
+      <backgroundcolorgreen>165</backgroundcolorgreen>
+      <backgroundcolorblue>0</backgroundcolorblue>
+      <bordercolorred>100</bordercolorred>
+      <bordercolorgreen>100</bordercolorgreen>
+      <bordercolorblue>100</bordercolorblue>
+      <drawshadow>Y</drawshadow>
+    </notepad>
   </notepads>
   <connection>
     <name>dw_pgsql_tse</name>

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

       <bordercolorblue>100</bordercolorblue>
       <drawshadow>Y</drawshadow>
     </notepad>
+    <notepad>
+      <note>carregar tse_politicos em transformação anterior
+se houver FK (h2: Timeout trying to lock table TSE_POLITICOS)</note>
+      <xloc>485</xloc>
+      <yloc>408</yloc>
+      <width>324</width>
+      <heigth>35</heigth>
+      <fontname>Microsoft Sans Serif</fontname>
+      <fontsize>8</fontsize>
+      <fontbold>N</fontbold>
+      <fontitalic>N</fontitalic>
+      <fontcolorred>0</fontcolorred>
+      <fontcolorgreen>0</fontcolorgreen>
+      <fontcolorblue>0</fontcolorblue>
+      <backgroundcolorred>255</backgroundcolorred>
+      <backgroundcolorgreen>165</backgroundcolorgreen>
+      <backgroundcolorblue>0</backgroundcolorblue>
+      <bordercolorred>100</bordercolorred>
+      <bordercolorgreen>100</bordercolorgreen>
+      <bordercolorblue>100</bordercolorblue>
+      <drawshadow>Y</drawshadow>
+    </notepad>
   </notepads>
   <connection>
     <name>dw_pgsql_tse</name>
     </step>
 
   <step>
+    <name>i&#47;u - tse_politicos</name>
+    <type>InsertUpdate</type>
+    <description/>
+    <distribute>Y</distribute>
+    <copies>1</copies>
+         <partitioning>
+           <method>none</method>
+           <schema_name/>
+           </partitioning>
+    <connection>dw_pgsql_tse</connection>
+    <commit>100</commit>
+    <update_bypassed>N</update_bypassed>
+    <lookup>
+      <schema/>
+      <table>tse_politicos</table>
+      <key>
+        <name>NUM_TITULO_ELEITORAL_CANDIDATO</name>
+        <field>NUM_TITULO_ELEITORAL_CANDIDATO</field>
+        <condition>=</condition>
+        <name2/>
+      </key>
+      <value>
+        <name>NM_CANDIDATO</name>
+        <rename>NM_CANDIDATO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>CD_OCUPACAO_CANDIDATO</name>
+        <rename>CD_OCUPACAO_CANDIDATO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>DS_OCUPACAO_CANDIDATO</name>
+        <rename>DS_OCUPACAO_CANDIDATO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>DT_NASCIMENTO</name>
+        <rename>DT_NASCIMENTO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>NUM_TITULO_ELEITORAL_CANDIDATO</name>
+        <rename>NUM_TITULO_ELEITORAL_CANDIDATO</rename>
+        <update>N</update>
+      </value>
+      <value>
+        <name>CD_SEXO</name>
+        <rename>CD_SEXO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>DS_SEXO</name>
+        <rename>DS_SEXO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>CD_GRAU_INSTRUCAO</name>
+        <rename>CD_GRAU_INSTRUCAO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>DS_GRAU_INSTRUCAO</name>
+        <rename>DS_GRAU_INSTRUCAO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>CD_ESTADO_CIVIL</name>
+        <rename>CD_ESTADO_CIVIL</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>DS_ESTADO_CIVIL</name>
+        <rename>DS_ESTADO_CIVIL</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>CD_NACIONALIDADE</name>
+        <rename>CD_NACIONALIDADE</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>DS_NACIONALIDADE</name>
+        <rename>DS_NACIONALIDADE</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>SIGLA_UF_NASCIMENTO</name>
+        <rename>SIGLA_UF_NASCIMENTO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>CODIGO_MUNICIPIO_NASCIMENTO</name>
+        <rename>CODIGO_MUNICIPIO_NASCIMENTO</rename>
+        <update>Y</update>
+      </value>
+      <value>
+        <name>NOME_MUNICIPIO_NASCIMENTO</name>
+        <rename>NOME_MUNICIPIO_NASCIMENTO</rename>
+        <update>Y</update>
+      </value>
+    </lookup>
+     <cluster_schema/>
+ <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
+      <xloc>559</xloc>
+      <yloc>354</yloc>
+      <draw>Y</draw>
+      </GUI>
+    </step>
+
+  <step>
     <name>id_partido &#47; id_candidato</name>
     <type>ScriptValueMod</type>
     <description/>
       </GUI>
     </step>
 
-  <step>
-    <name>i&#47;u - tse_politicos</name>
-    <type>InsertUpdate</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <connection>dw_pgsql_tse</connection>
-    <commit>100</commit>
-    <update_bypassed>N</update_bypassed>
-    <lookup>
-      <schema/>
-      <table>tse_politicos</table>
-      <key>
-        <name>NUM_TITULO_ELEITORAL_CANDIDATO</name>
-        <field>NUM_TITULO_ELEITORAL_CANDIDATO</field>
-        <condition>=</condition>
-        <name2/>
-      </key>
-      <value>
-        <name>NM_CANDIDATO</name>
-        <rename>NM_CANDIDATO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>CD_OCUPACAO_CANDIDATO</name>
-        <rename>CD_OCUPACAO_CANDIDATO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>DS_OCUPACAO_CANDIDATO</name>
-        <rename>DS_OCUPACAO_CANDIDATO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>DT_NASCIMENTO</name>
-        <rename>DT_NASCIMENTO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>NUM_TITULO_ELEITORAL_CANDIDATO</name>
-        <rename>NUM_TITULO_ELEITORAL_CANDIDATO</rename>
-        <update>N</update>
-      </value>
-      <value>
-        <name>CD_SEXO</name>
-        <rename>CD_SEXO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>DS_SEXO</name>
-        <rename>DS_SEXO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>CD_GRAU_INSTRUCAO</name>
-        <rename>CD_GRAU_INSTRUCAO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>DS_GRAU_INSTRUCAO</name>
-        <rename>DS_GRAU_INSTRUCAO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>CD_ESTADO_CIVIL</name>
-        <rename>CD_ESTADO_CIVIL</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>DS_ESTADO_CIVIL</name>
-        <rename>DS_ESTADO_CIVIL</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>CD_NACIONALIDADE</name>
-        <rename>CD_NACIONALIDADE</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>DS_NACIONALIDADE</name>
-        <rename>DS_NACIONALIDADE</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>SIGLA_UF_NASCIMENTO</name>
-        <rename>SIGLA_UF_NASCIMENTO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>CODIGO_MUNICIPIO_NASCIMENTO</name>
-        <rename>CODIGO_MUNICIPIO_NASCIMENTO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>NOME_MUNICIPIO_NASCIMENTO</name>
-        <rename>NOME_MUNICIPIO_NASCIMENTO</rename>
-        <update>Y</update>
-      </value>
-    </lookup>
-     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>559</xloc>
-      <yloc>354</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
   <step_error_handling>
       <error>
         <source_step>I&#47;U - tse_candidatos</source_step>

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

       <bordercolorblue>100</bordercolorblue>
       <drawshadow>Y</drawshadow>
     </notepad>
-    <notepad>
-      <note>nao carregar tse_partidos invalidos juntamente com os vĂĄlidos!</note>
-      <xloc>557</xloc>
-      <yloc>603</yloc>
-      <width>317</width>
-      <heigth>22</heigth>
-      <fontname>Microsoft Sans Serif</fontname>
-      <fontsize>8</fontsize>
-      <fontbold>N</fontbold>
-      <fontitalic>N</fontitalic>
-      <fontcolorred>0</fontcolorred>
-      <fontcolorgreen>0</fontcolorgreen>
-      <fontcolorblue>0</fontcolorblue>
-      <backgroundcolorred>255</backgroundcolorred>
-      <backgroundcolorgreen>165</backgroundcolorgreen>
-      <backgroundcolorblue>0</backgroundcolorblue>
-      <bordercolorred>100</bordercolorred>
-      <bordercolorgreen>100</bordercolorgreen>
-      <bordercolorblue>100</bordercolorblue>
-      <drawshadow>Y</drawshadow>
-    </notepad>
   </notepads>
   <connection>
     <name>dw_pgsql_tse</name>
     </attributes>
   </connection>
   <order>
-  <hop> <from>CSV - lista cand</from><to>renames</to><enabled>Y</enabled> </hop>  <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>Select values - partidos</to><enabled>Y</enabled> </hop>  <hop> <from>Select values - partidos</from><to>Unique - partidos</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>Select values</from><to>select eleicao&#47;uf</to><enabled>Y</enabled> </hop>  <hop> <from>select eleicao&#47;uf</from><to>unique eleicao&#47;uf</to><enabled>N</enabled> </hop>  <hop> <from>unique eleicao&#47;uf</from><to>join</to><enabled>N</enabled> </hop>  <hop> <from>CSV - tipos votos invalidos</from><to>join</to><enabled>N</enabled> </hop>  <hop> <from>Select values 3</from><to>I&#47;U - tse_partidos - invalidos</to><enabled>N</enabled> </hop>  <hop> <from>join</from><to>id_partido_invalido</to><enabled>N</enabled> </hop>  <hop> <from>id_partido_invalido</from><to>Select values 3</to><enabled>N</enabled> </hop>  <hop> <from>Dummy (do nothing)</from><to>id_partido &#47; id_candidato</to><enabled>Y</enabled> </hop>  <hop> <from>Unique - partidos</from><to>I&#47;U - tse_partidos</to><enabled>Y</enabled> </hop>  </order>
+  <hop> <from>CSV - lista cand</from><to>renames</to><enabled>Y</enabled> </hop>  <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>Select values - partidos</to><enabled>Y</enabled> </hop>  <hop> <from>Select values - partidos</from><to>Unique - partidos</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>Dummy (do nothing)</from><to>id_partido &#47; id_candidato</to><enabled>Y</enabled> </hop>  <hop> <from>Unique - partidos</from><to>I&#47;U - tse_partidos</to><enabled>Y</enabled> </hop>  </order>
   <step>
     <name>CSV - lista cand</name>
     <type>CsvInput</type>
     </step>
 
   <step>
-    <name>CSV - tipos votos invalidos</name>
-    <type>CsvInput</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <filename>${dadostse.projectdir}&#47;dados-padrao&#47;tipos_voto_invalido.csv</filename>
-    <filename_field/>
-    <rownum_field/>
-    <include_filename>N</include_filename>
-    <separator>;</separator>
-    <enclosure/>
-    <header>Y</header>
-    <buffer_size>50000</buffer_size>
-    <lazy_conversion>Y</lazy_conversion>
-    <add_filename_result>N</add_filename_result>
-    <parallel>N</parallel>
-    <newline_possible>Y</newline_possible>
-    <encoding/>
-    <fields>
-      <field>
-        <name>NR_PARTIDO</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_PARTIDO</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>6</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-      <field>
-        <name>NM_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>NM_LEGENDA</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>DS_LEGENDA</name>
-        <type>String</type>
-        <format/>
-        <currency>R$</currency>
-        <decimal>,</decimal>
-        <group>.</group>
-        <length>20</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-      </field>
-    </fields>
-     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>566</xloc>
-      <yloc>550</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
     <name>Database lookup</name>
     <type>DBLookup</type>
     <description/>
     </step>
 
   <step>
-    <name>I&#47;U - tse_partidos - invalidos</name>
-    <type>InsertUpdate</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <connection>dw_pgsql_tse</connection>
-    <commit>100</commit>
-    <update_bypassed>N</update_bypassed>
-    <lookup>
-      <schema/>
-      <table>tse_partidos</table>
-      <key>
-        <name>ID_PARTIDO</name>
-        <field>ID_PARTIDO</field>
-        <condition>=</condition>
-        <name2/>
-      </key>
-      <value>
-        <name>ANO_ELEICAO</name>
-        <rename>ANO_ELEICAO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>SIGLA_UE</name>
-        <rename>SIGLA_UE</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>NR_PARTIDO</name>
-        <rename>NR_PARTIDO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>SIGLA_PARTIDO</name>
-        <rename>SIGLA_PARTIDO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>NM_PARTIDO</name>
-        <rename>NM_PARTIDO</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>NM_LEGENDA</name>
-        <rename>NM_LEGENDA</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>DS_LEGENDA</name>
-        <rename>DS_LEGENDA</rename>
-        <update>Y</update>
-      </value>
-      <value>
-        <name>ID_PARTIDO</name>
-        <rename>ID_PARTIDO</rename>
-        <update>N</update>
-      </value>
-      <value>
-        <name>ID_UE</name>
-        <rename>ID_UE</rename>
-        <update>N</update>
-      </value>
-    </lookup>
-     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>833</xloc>
-      <yloc>475</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
     <name>Select values</name>
     <type>SelectValues</type>
     <description/>
     </step>
 
   <step>
-    <name>Select values 3</name>
-    <type>SelectValues</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <fields>      <field>        <name>ANO_ELEICAO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_UE</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NR_PARTIDO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_PARTIDO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NM_PARTIDO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>NM_LEGENDA</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>DS_LEGENDA</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>ID_PARTIDO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>ID_UE</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>776</xloc>
-      <yloc>546</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
     <name>Unique - partidos</name>
     <type>UniqueRowsByHashSet</type>
     <description/>
     </step>
 
   <step>
-    <name>id_partido_invalido</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)
-	;
-</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>    </fields>     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>730</xloc>
-      <yloc>473</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
-    <name>join</name>
-    <type>JoinRows</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-      <directory>%%java.io.tmpdir%%</directory>
-      <prefix>out</prefix>
-      <cache_size>500</cache_size>
-      <main/>
-    <compare>
-<condition>
- <negated>N</negated>
- <leftvalue/>
- <function>=</function>
- <rightvalue/>
- </condition>
-    </compare>
-     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>680</xloc>
-      <yloc>549</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
     <name>renames</name>
     <type>SelectValues</type>
     <description/>
       </GUI>
     </step>
 
-  <step>
-    <name>select eleicao&#47;uf</name>
-    <type>SelectValues</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-    <fields>      <field>        <name>ANO_ELEICAO</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>SIGLA_UE</name>
-        <rename/>
-        <length>-2</length>
-        <precision>-2</precision>
-      </field>      <field>        <name>ID_UE</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>505</xloc>
-      <yloc>486</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
-  <step>
-    <name>unique eleicao&#47;uf</name>
-    <type>UniqueRowsByHashSet</type>
-    <description/>
-    <distribute>Y</distribute>
-    <copies>1</copies>
-         <partitioning>
-           <method>none</method>
-           <schema_name/>
-           </partitioning>
-      <store_values>N</store_values>
-      <reject_duplicate_row>N</reject_duplicate_row>
-      <error_description/>
-    <fields>      </fields>     <cluster_schema/>
- <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
-      <xloc>612</xloc>
-      <yloc>479</yloc>
-      <draw>Y</draw>
-      </GUI>
-    </step>
-
   <step_error_handling>
   </step_error_handling>
    <slave-step-copy-partition-distribution>
 	references tse_partidos (id_partido);
 
 alter table tse_candidatos
+	add constraint cand_politico_fk foreign key (num_titulo_eleitoral_candidato)
+	references tse_politicos (num_titulo_eleitoral_candidato);
+
+alter table tse_candidatos
 	add constraint cand_situ_fk foreign key (cd_situacao_candidato)
 	references tse_situacao_candidato (cd_situacao_candidato);