//int expectedBatchCount = 2;
//assertEquals(expectedBatchCount, results.size());
for (int i = 0; i < results.size(); ++i) {
QueryResultBatch batch = results.get(i);
if (i == 0) {
assertTrue(batch.hasData());
} else {
assertFalse(batch.hasData());
return;
}
assertTrue(batchLoader.load(batch.getHeader().getDef(), batch.getData()));
boolean firstColumn = true;
// print headers.
System.out.println("\n\n========NEW SCHEMA=========\n\n");
for (VectorWrapper<?> v : batchLoader) {
if (firstColumn) {
firstColumn = false;
} else {
System.out.print("\t");
}
System.out.print(v.getField().toExpr());
System.out.print("[");
System.out.print(v.getField().getType().getMinorType());
System.out.print("]");
}
System.out.println();
for (int r = 0; r < batchLoader.getRecordCount(); r++) {
boolean first = true;
recordCount++;
for (VectorWrapper<?> v : batchLoader) {
if (first) {
first = false;
} else {
System.out.print("\t");
}
ValueVector.Accessor accessor = v.getValueVector().getAccessor();
System.out.print(accessor.getObject(r));
}
if (!first) System.out.println();
}
batchLoader.clear();
batch.release();
}
assertEquals(2, recordCount);
}
}