You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ARROW_EXPORT AggregateNodeOptions : public ExecNodeOptions {
public:
// aggregations which will be applied to the targetted fields
std::vector<internal::Aggregate> aggregates;
// fields to which aggregations will be applied
std::vector<FieldRef> targets;
// output field names for aggregations
std::vector<std::string> names;
// keys by which aggregations will be grouped
std::vector<FieldRef> keys;
};
It is not very obvious how aggregates and targets are related. My initial read of the comments led me to think that each aggregate would be applied to each target and you would end up with len(aggregates) * len(targets) output fields. In reality the aggregate at index i only applies to the target at index i. It would be simpler to add a FieldRef target to internal::Aggregate (and Aggregate should not be internal).
Alternatively, the entire internal::Aggregate could be replaced by a "call" arrow::compute::Expression
Vibhatha Lakmal Abeykoon / @vibhatha:
cc @westonpace I think this make sense. Also it is easier for the user. I think it would be okay to have it as a field within the Aggregate and put it in arrow::compute:: namespace as you're suggesting. But call is much straight forward.
But to make it clear to the user, I would say the struct is fine for now. WDYT?
Currently AggregateNodeOptions is:
It is not very obvious how
aggregates
andtargets
are related. My initial read of the comments led me to think that each aggregate would be applied to each target and you would end up withlen(aggregates) * len(targets)
output fields. In reality theaggregate
at indexi
only applies to thetarget
at indexi
. It would be simpler to add aFieldRef target
tointernal::Aggregate
(andAggregate
should not beinternal
).Alternatively, the entire
internal::Aggregate
could be replaced by a "call"arrow::compute::Expression
Reporter: Weston Pace / @westonpace
Assignee: Vibhatha Lakmal Abeykoon / @vibhatha
PRs and other links:
Note: This issue was originally created as ARROW-16549. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: