Options

[SOLVED] Name conflict detection when renaming multiple attributes

tennenrishintennenrishin Member Posts: 177 Contributor II
edited November 2018 in Help
Is the following process supposed to throw an error? Prefixing all names with 'a' should not introduce any conflicts in the resulting name set, I would think.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.005">
 <context>
   <input/>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.3.005" expanded="true" name="Process">
   <process expanded="true">
     <operator activated="true" class="generate_data_user_specification" compatibility="5.3.005" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="112" y="75">
       <list key="attribute_values">
         <parameter key="a" value="1"/>
         <parameter key="aa" value="2"/>
       </list>
       <list key="set_additional_roles"/>
     </operator>
     <operator activated="true" class="rename_by_replacing" compatibility="5.3.005" expanded="true" height="76" name="Rename by Replacing" width="90" x="313" y="75">
       <parameter key="replace_what" value="^"/>
       <parameter key="replace_by" value="a"/>
     </operator>
     <connect from_op="Generate Data by User Specification" from_port="output" to_op="Rename by Replacing" to_port="example set input"/>
     <connect from_op="Rename by Replacing" from_port="example set output" to_port="result 1"/>
     <portSpacing port="source_input 1" spacing="0"/>
     <portSpacing port="sink_result 1" spacing="0"/>
     <portSpacing port="sink_result 2" spacing="0"/>
   </process>
 </operator>
</process>

Answers

  • Options
    awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
    I reckon you'd need (.*) as the search string and a$1 as the replacement. The $1 numbered group ensures the existing name is retained.

    Andrew
  • Options
    MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    I created an internal bug report requesting that duplicate attribute names are checked with respect to the final result set, not on intermediate results.
Sign In or Register to comment.