private CubeScanAggregate getCubeScanAggregate(CubeQueryAggregate aggregate, CubeDescriptor cubeDescriptor)
throws OLAPEngineException {
if(aggregate.getAggregate().toLowerCase().startsWith("sum("))
return new SumCubeScanAggregate(aggregate.getAggregate(), cubeDescriptor);
if(aggregate.getAggregate().toLowerCase().startsWith("max("))
return new MaxCubeScanAggregate(aggregate.getAggregate(), cubeDescriptor);
if(aggregate.getAggregate().toLowerCase().startsWith("min("))
return new MinCubeScanAggregate(aggregate.getAggregate(), cubeDescriptor);
if(aggregate.getAggregate().toLowerCase().startsWith("count("))
return new CountCubeScanAggregate(aggregate.getAggregate(), cubeDescriptor);
throw new OLAPEngineException("can't process aggregate " + aggregate.getAggregate());