Just generalize this and let the AggregateFunctionParseNode annotation do the type checking. It'd be nice to add a range check to the annotation specification we have too, so you could specify a min/max in the function annotation.