}
@Test public void testLimitProducesMultipleBatches() throws Exception {
LimitNode node = getLimitNode(130, new FakeRelationalNode(2, getRows(300), 50));
TupleBatch batch = node.nextBatch();
assertNotNull(batch);
assertEquals(50, batch.getRowCount());
assertEquals(1, batch.getBeginRow());
assertEquals(50, batch.getEndRow());
assertFalse(batch.getTerminationFlag());
batch = node.nextBatch();
assertNotNull(batch);
assertEquals(50, batch.getRowCount());
assertEquals(51, batch.getBeginRow());
assertEquals(100, batch.getEndRow());
assertFalse(batch.getTerminationFlag());
batch = node.nextBatch();
assertNotNull(batch);
assertEquals(30, batch.getRowCount());
assertEquals(101, batch.getBeginRow());
assertEquals(130, batch.getEndRow());
assertTrue(batch.getTerminationFlag());
}