"[ACKED] Aggregate operator's use default aggregation behavior"
tennenrishin
New Altair Community Member
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).
(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.)
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).
<?xml version="1.0" encoding="UTF-8" standalone="no"?>Am I misunderstanding the purpose of this operator's attribute filter?
<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>
(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.)
0
Answers
-
Thanks for the report. I created an internal bug report for this.
Best,
Marius0 -
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,
Marius0