Pages: [1]
  Print  
Author Topic: [ACKED] Aggregate operator's "use default aggregation" behavior  (Read 188 times)
tennenrishin
Full Member
***
Posts: 129


WWW
« on: July 10, 2012, 01:58:53 PM »

I need to generate aggregates (e.g. sum) for each attribute whose name complies with a given regular expression.

However, the Aggregate operator (with "use default aggregation" checked) seems to ignore the attribute filter. For example, the process below generates an ExampleSet with both sum(a) and sum(b), rather than just sum(a).

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.006">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.2.006" expanded="true" name="Process">
    <process expanded="true" height="460" width="748">
      <operator activated="true" class="generate_data_user_specification" compatibility="5.2.006" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="122" y="121">
        <list key="attribute_values">
          <parameter key="a" value="1"/>
          <parameter key="b" value="2"/>
        </list>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="multiply" compatibility="5.2.006" expanded="true" height="94" name="Multiply" width="90" x="251" y="120"/>
      <operator activated="true" class="union" compatibility="5.2.006" expanded="true" height="76" name="Union" width="90" x="380" y="120"/>
      <operator activated="true" class="aggregate" compatibility="5.2.006" expanded="true" height="76" name="Aggregate" width="90" x="514" y="120">
        <parameter key="use_default_aggregation" value="true"/>
        <parameter key="attribute_filter_type" value="regular_expression"/>
        <parameter key="attributes" value="a|"/>
        <parameter key="regular_expression" value="a"/>
        <parameter key="default_aggregation_function" value="sum"/>
        <list key="aggregation_attributes"/>
      </operator>
      <connect from_op="Generate Data by User Specification" from_port="output" to_op="Multiply" to_port="input"/>
      <connect from_op="Multiply" from_port="output 1" to_op="Union" to_port="example set 1"/>
      <connect from_op="Multiply" from_port="output 2" to_op="Union" to_port="example set 2"/>
      <connect from_op="Union" from_port="union" to_op="Aggregate" to_port="example set input"/>
      <connect from_op="Aggregate" 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>

Am I misunderstanding the purpose of this operator's attribute filter?

(In the simple case above, I could, of course, just filter the unwanted attributes out using Select Attributes, but in cases where "group-by" attributes are needed, this workaround is not possible.)
« Last Edit: July 12, 2012, 11:37:11 AM by tennenrishin » Logged
Marius
Global Moderator
Hero Member
*****
Posts: 1283



WWW
« Reply #1 on: July 11, 2012, 12:33:23 PM »

Thanks for the report. I created an internal bug report for this.

Best,
  Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
Marius
Global Moderator
Hero Member
*****
Posts: 1283



WWW
« Reply #2 on: August 27, 2012, 10:37:41 AM »

This has been fixed, at least in the latest development version. Currently I'm not sure if it also made it into RM 5.2.8, but I think so.

Best,
  Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
Pages: [1]
  Print  
 
Jump to: