Search in sources :

Example 11 with BatchIterator

use of io.crate.data.BatchIterator in project crate by crate.

the class NestedLoopBatchIteratorsTest method testAntiJoin.

@Test
public void testAntiJoin() throws Exception {
    Supplier<BatchIterator<Row>> batchIteratorSupplier = () -> new AntiJoinNLBatchIterator<>(TestingBatchIterators.range(0, 5), TestingBatchIterators.range(2, 4), new CombinedRow(1, 1), getCol0EqCol1JoinCondition());
    BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
    tester.verifyResultAndEdgeCaseBehaviour(antiJoinResult);
}
Also used : BatchIteratorTester(io.crate.testing.BatchIteratorTester) InMemoryBatchIterator(io.crate.data.InMemoryBatchIterator) BatchIterator(io.crate.data.BatchIterator) Test(org.junit.Test)

Example 12 with BatchIterator

use of io.crate.data.BatchIterator in project crate by crate.

the class NestedLoopBatchIteratorsTest method testRightJoin.

@Test
public void testRightJoin() throws Exception {
    Supplier<BatchIterator<Row>> batchIteratorSupplier = () -> new RightJoinNLBatchIterator<>(TestingBatchIterators.range(0, 4), TestingBatchIterators.range(2, 6), new CombinedRow(1, 1), getCol0EqCol1JoinCondition());
    BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
    tester.verifyResultAndEdgeCaseBehaviour(rightJoinResult);
}
Also used : BatchIteratorTester(io.crate.testing.BatchIteratorTester) InMemoryBatchIterator(io.crate.data.InMemoryBatchIterator) BatchIterator(io.crate.data.BatchIterator) Test(org.junit.Test)

Example 13 with BatchIterator

use of io.crate.data.BatchIterator in project crate by crate.

the class NestedLoopBatchIteratorsTest method testSemiJoin.

@Test
public void testSemiJoin() throws Exception {
    Supplier<BatchIterator<Row>> batchIteratorSupplier = () -> new SemiJoinNLBatchIterator<>(TestingBatchIterators.range(0, 5), TestingBatchIterators.range(2, 6), new CombinedRow(1, 0), getCol0EqCol1JoinCondition());
    BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
    tester.verifyResultAndEdgeCaseBehaviour(semiJoinResult);
}
Also used : BatchIteratorTester(io.crate.testing.BatchIteratorTester) InMemoryBatchIterator(io.crate.data.InMemoryBatchIterator) BatchIterator(io.crate.data.BatchIterator) Test(org.junit.Test)

Example 14 with BatchIterator

use of io.crate.data.BatchIterator in project crate by crate.

the class NestedLoopBatchIteratorsTest method testLeftJoinBatchedSource.

@Test
public void testLeftJoinBatchedSource() throws Exception {
    Supplier<BatchIterator<Row>> batchIteratorSupplier = () -> new LeftJoinNLBatchIterator<>(new BatchSimulatingIterator<>(TestingBatchIterators.range(0, 4), 2, 2, null), new BatchSimulatingIterator<>(TestingBatchIterators.range(2, 6), 2, 2, null), new CombinedRow(1, 1), getCol0EqCol1JoinCondition());
    BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
    tester.verifyResultAndEdgeCaseBehaviour(leftJoinResult);
}
Also used : BatchIteratorTester(io.crate.testing.BatchIteratorTester) InMemoryBatchIterator(io.crate.data.InMemoryBatchIterator) BatchIterator(io.crate.data.BatchIterator) Test(org.junit.Test)

Example 15 with BatchIterator

use of io.crate.data.BatchIterator in project crate by crate.

the class NestedLoopBatchIteratorsTest method testAntiJoinBatchedSource.

@Test
public void testAntiJoinBatchedSource() throws Exception {
    Supplier<BatchIterator<Row>> batchIteratorSupplier = () -> new AntiJoinNLBatchIterator<>(new BatchSimulatingIterator<>(TestingBatchIterators.range(0, 5), 2, 2, null), new BatchSimulatingIterator<>(TestingBatchIterators.range(2, 4), 2, 2, null), new CombinedRow(1, 1), getCol0EqCol1JoinCondition());
    BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
    tester.verifyResultAndEdgeCaseBehaviour(antiJoinResult);
}
Also used : BatchIteratorTester(io.crate.testing.BatchIteratorTester) InMemoryBatchIterator(io.crate.data.InMemoryBatchIterator) BatchIterator(io.crate.data.BatchIterator) Test(org.junit.Test)

Aggregations

BatchIterator (io.crate.data.BatchIterator)50 Test (org.junit.Test)37 BatchIteratorTester (io.crate.testing.BatchIteratorTester)22 InMemoryBatchIterator (io.crate.data.InMemoryBatchIterator)17 Row (io.crate.data.Row)16 ArrayList (java.util.ArrayList)10 CrateUnitTest (io.crate.test.integration.CrateUnitTest)8 List (java.util.List)8 Map (java.util.Map)7 CompletableFuture (java.util.concurrent.CompletableFuture)7 Bucket (io.crate.data.Bucket)6 InputFactory (io.crate.expression.InputFactory)6 Symbol (io.crate.analyze.symbol.Symbol)4 RowAccounting (io.crate.breaker.RowAccounting)4 RowN (io.crate.data.RowN)4 CombinedRow (io.crate.data.join.CombinedRow)4 InputFactory (io.crate.operation.InputFactory)4 TestingHelpers.isRow (io.crate.testing.TestingHelpers.isRow)4 UUID (java.util.UUID)4 ClusterService (org.elasticsearch.cluster.service.ClusterService)4