}
@Test
public void testCollectShardExpressionsWhereShardIdIs0() throws Exception {
EqOperator op = (EqOperator) functions.get(new FunctionIdent(
EqOperator.NAME, ImmutableList.<DataType>of(DataTypes.INTEGER, DataTypes.INTEGER)));
CollectNode collectNode = new CollectNode("shardCollect", shardRouting(0, 1));
collectNode.toCollect(Arrays.<Symbol>asList(testShardIdReference));
collectNode.whereClause(new WhereClause(
new Function(op.info(), Arrays.<Symbol>asList(testShardIdReference, Literal.newLiteral(0)))));
collectNode.maxRowGranularity(RowGranularity.SHARD);
Object[][] result = operation.collect(collectNode).get();
assertThat(result.length, is(equalTo(1)));
assertThat((Integer) result[0][0], is(0));
}