@Test
public void testCollectWithPartitionedColumns() throws Exception {
Routing routing = docSchemaInfo.getTableInfo(PARTITIONED_TABLE_NAME).getRouting(WhereClause.MATCH_ALL);
TableIdent tableIdent = new TableIdent(DocSchemaInfo.NAME, PARTITIONED_TABLE_NAME);
CollectNode collectNode = new CollectNode("docCollect", routing);
collectNode.toCollect(Arrays.<Symbol>asList(
new Reference(new ReferenceInfo(
new ReferenceIdent(tableIdent, "id"),
RowGranularity.DOC, DataTypes.INTEGER)),
new Reference(new ReferenceInfo(
new ReferenceIdent(tableIdent, "date"),
RowGranularity.SHARD, DataTypes.TIMESTAMP))
));
collectNode.maxRowGranularity(RowGranularity.DOC);
collectNode.isPartitioned(true);
Object[][] result = operation.collect(collectNode).get();
assertThat(result.length, is(2));
assertThat((Integer)result[0][0], isOneOf(1,2));
assertThat((Integer)result[1][0], isOneOf(1,2));