/** select count(A1) from T1 group by A1 */
public void testSelectCountAGroupbyA() throws IOException,
ProcCallException {
Client client = this.getClient();
VoltTable vt;
loaderNxN(client, 0);
vt = client.callProcedure("@AdHoc",
"select count(A1) from T1 group by A1").getResults()[0];
System.out.println("testSelectCountAGroupbyA result: " + vt);
assertTrue(vt.getRowCount() == 11);
// Selecting count(A1) - should get two counts of 1 and one count each
// of 2-10: (1, 1, 2, 3, 4, .. 10).
// These results aren't necessarily ordered
int found[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
while (vt.advanceRow()) {
Integer A1 = (Integer) vt.get(0, VoltType.INTEGER);
assertTrue(A1 <= 10);
assertTrue(A1 > 0);
found[A1.intValue()] += 1;
}
assertEquals(0, found[0]);