Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: rboccuzzi1) Most of the code is shared, but not all. You are correct in that very little is different between the agg and filter nodes. Agg nodes give you the ability to "see into the future" by knowing when the current record is the last in a group (and setting the lastInGroup flag), filters don't. Otherwise, the only real difference is that when you use the group macros, filters are only one group, the whole input, and aggs have groups based on the groupBy expression.
2) You can look at the actual expansion of the groupMax and groupMin macros by putting them in a node and pressing F3, and you will see that actually, it is very straight forward. The macros just expand to an expression. I am not sure what you mean about processing the data twice. If you say:
x = groupMax(someField)
emit x
that will be equivalent to saying:
if firstInGroup then
x = someField
else
x = max(x, someField)
emit x
you can see, the emit doesn't change in either case.
hope that helps.
$Rich