setSelectedColumns(report, scan);
logger.debug("Scan object is " + scan);
if (report.isAggregateReport()) {
//means we have to aggregate
GroupingAggregationBatch batchCall = new GroupingAggregationBatch(scan, report);
GroupingAggregationBatchCallback callback = new GroupingAggregationBatchCallback(report);
try {
hTable.coprocessorExec(
GroupingAggregationProtocol.class, scan.getStartRow(), scan.getStopRow(),
batchCall, callback);
}
catch(Throwable e) {
e.printStackTrace();
throw new CruxException("Error executing query", e);
}
return new CruxScannerListImpl(callback.getAggregates());
}
else {
ResultScanner resultScanner = hTable.getScanner(scan);
scanner = new CruxScannerResultScannerImpl(resultScanner, report);
}