}
public AggImplementor get(final Aggregation aggregation,
boolean forWindowAggregate) {
if (aggregation instanceof SqlUserDefinedAggFunction) {
final SqlUserDefinedAggFunction udaf =
(SqlUserDefinedAggFunction) aggregation;
if (!(udaf.function instanceof ImplementableAggFunction)) {
throw new IllegalStateException(
"User defined aggregation " + aggregation + " must implement "
+ "ImplementableAggFunction");