Search in sources :

Example 6 with CombinedRow

use of io.crate.data.join.CombinedRow in project crate by crate.

the class HashInnerJoinBatchIteratorTest method testInnerHashJoinWithHashCollisions.

@Test
public void testInnerHashJoinWithHashCollisions() throws Exception {
    Supplier<BatchIterator<Row>> batchIteratorSupplier = () -> new HashInnerJoinBatchIterator(leftIterator.get(), rightIterator.get(), mock(RowAccounting.class), new CombinedRow(1, 1), getCol0EqCol1JoinCondition(), getHashWithCollisions(), getHashWithCollisions(), () -> 5);
    BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
    tester.verifyResultAndEdgeCaseBehaviour(expectedResult);
}
Also used : RowAccounting(io.crate.breaker.RowAccounting) BatchIteratorTester(io.crate.testing.BatchIteratorTester) BatchIterator(io.crate.data.BatchIterator) CombinedRow(io.crate.data.join.CombinedRow) Test(org.junit.Test)

Example 7 with CombinedRow

use of io.crate.data.join.CombinedRow in project crate by crate.

the class HashInnerJoinBatchIteratorTest method testInnerHashJoinWithBlockSizeBiggerThanIteratorBatchSize.

@Test
public void testInnerHashJoinWithBlockSizeBiggerThanIteratorBatchSize() throws Exception {
    Supplier<BatchIterator<Row>> batchIteratorSupplier = () -> new HashInnerJoinBatchIterator(leftIterator.get(), rightIterator.get(), mock(RowAccounting.class), new CombinedRow(1, 1), getCol0EqCol1JoinCondition(), getHashForLeft(), getHashForRight(), () -> 3);
    BatchIteratorTester tester = new BatchIteratorTester(batchIteratorSupplier);
    tester.verifyResultAndEdgeCaseBehaviour(expectedResult);
}
Also used : RowAccounting(io.crate.breaker.RowAccounting) BatchIteratorTester(io.crate.testing.BatchIteratorTester) BatchIterator(io.crate.data.BatchIterator) CombinedRow(io.crate.data.join.CombinedRow) Test(org.junit.Test)

Aggregations

CombinedRow (io.crate.data.join.CombinedRow)7 Test (org.junit.Test)7 RowAccounting (io.crate.breaker.RowAccounting)6 BatchIterator (io.crate.data.BatchIterator)4 BatchIteratorTester (io.crate.testing.BatchIteratorTester)4 Row (io.crate.data.Row)3 BatchSimulatingIterator (io.crate.testing.BatchSimulatingIterator)3 TestingRowConsumer (io.crate.testing.TestingRowConsumer)3