long ms = System.currentTimeMillis();
AggregateResultSet rs = query.execute();
closeables.addFirst(rs);
while (rs.hasNext()) {
rs.next();
AggregateResult ar = rs.current();
System.out.printf("%032X sum/cnt: impCnt %.4f/%d, click %.4f/%d\n",
new BigInteger(1, (byte[]) ar.getGroupMember("dim1")),
ar.getAggregate("impCnt", "SUM"),
ar.getAggregate("impCnt", "COUNT"),
ar.getAggregate("click", "SUM"),
ar.getAggregate("click", "COUNT"));
}
closeables.remove(rs);
rs.close();
System.out.printf("query+printout complete in %d ms\n", System.currentTimeMillis() - ms);