use of io.crate.testing.BatchIteratorTester in project crate by crate.
the class LimitingBatchIteratorTest method testLimitingBatchIteratorWithBatchedSource.
@Test
public void testLimitingBatchIteratorWithBatchedSource() throws Exception {
BatchIteratorTester tester = new BatchIteratorTester(() -> {
BatchSimulatingIterator batchSimulatingIt = new BatchSimulatingIterator(TestingBatchIterators.range(0, 10), 2, 5, null);
return LimitingBatchIterator.newInstance(batchSimulatingIt, limit);
});
tester.verifyResultAndEdgeCaseBehaviour(expectedResult);
}
use of io.crate.testing.BatchIteratorTester in project crate by crate.
the class NestedLoopBatchIteratorTest method testFullOuterJoinBatchedSource.
@Test
public void testFullOuterJoinBatchedSource() throws Exception {
Supplier<BatchIterator> batchIteratorSupplier = () -> NestedLoopBatchIterator.fullOuterJoin(new BatchSimulatingIterator(TestingBatchIterators.range(0, 4), 2, 2, null), new BatchSimulatingIterator(TestingBatchIterators.range(2, 6), 2, 2, null), getCol0EqCol1JoinCondition());
BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
tester.verifyResultAndEdgeCaseBehaviour(fullJoinResult);
}
use of io.crate.testing.BatchIteratorTester in project crate by crate.
the class NestedLoopBatchIteratorTest method testRightJoinBatchedSource.
@Test
public void testRightJoinBatchedSource() throws Exception {
Supplier<BatchIterator> batchIteratorSupplier = () -> NestedLoopBatchIterator.rightJoin(new BatchSimulatingIterator(TestingBatchIterators.range(0, 4), 2, 2, null), new BatchSimulatingIterator(TestingBatchIterators.range(2, 6), 2, 2, null), getCol0EqCol1JoinCondition());
BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
tester.verifyResultAndEdgeCaseBehaviour(rightJoinResult);
}
use of io.crate.testing.BatchIteratorTester in project crate by crate.
the class NestedLoopBatchIteratorTest method testNestedLoopWithBatchedSource.
@Test
public void testNestedLoopWithBatchedSource() throws Exception {
BatchIteratorTester tester = new BatchIteratorTester(() -> NestedLoopBatchIterator.crossJoin(new BatchSimulatingIterator(TestingBatchIterators.range(0, 3), 2, 2, null), new BatchSimulatingIterator(TestingBatchIterators.range(0, 3), 2, 2, null)));
tester.verifyResultAndEdgeCaseBehaviour(threeXThreeRows);
}
use of io.crate.testing.BatchIteratorTester in project crate by crate.
the class NestedLoopBatchIteratorTest method testLeftJoinBatchedSource.
@Test
public void testLeftJoinBatchedSource() throws Exception {
Supplier<BatchIterator> batchIteratorSupplier = () -> NestedLoopBatchIterator.leftJoin(new BatchSimulatingIterator(TestingBatchIterators.range(0, 4), 2, 2, null), new BatchSimulatingIterator(TestingBatchIterators.range(2, 6), 2, 2, null), getCol0EqCol1JoinCondition());
BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
tester.verifyResultAndEdgeCaseBehaviour(leftJoinResult);
}
Aggregations