Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
AggregateCall has a name field, and it is currently used to populate the name of the output field. But it makes as much sense for an aggregate call, say COUNT( x ), to have a name as for a call to a regular operator, say x + y.
Obsolete the name field, and provide another means to specify the output field names of an Aggregate.
Here is a proposal:
- Add RelDataType rowType argument to the constructor of Aggregate (and sub-types such as LogicalAggregate)
- Add Map<Integer, String> fieldNames argument to Aggregate#create; if there is not an entry for a particular output field ordinal, uses the current rule (input field for grouping fields, "i$" + grouping field for indicators, "f$" + n for aggregate calls).
- Remove the String name argument from AggregateCall constructor.
- Existing methods will remain, deprecated, to be removed just before 2.0.
Thus if you currently create an AggregateCall with a name, you would instead pass that name in via the fieldNames map. Aggregate would assign a row-type during construction.
Attachments
Issue Links
- is related to
-
CALCITE-704 FILTER clause for aggregate functions
- Closed