Use CountAggregateFunction.NAME here instead (I've changed this constant to be upper case).