Search in sources :

Example 1 with CrossJoinNLBatchIterator

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

the class NestedLoopOperation method buildCrossJoinBatchIterator.

private static BatchIterator<Row> buildCrossJoinBatchIterator(BatchIterator<Row> left, BatchIterator<Row> right, CombinedRow combiner, CircuitBreaker circuitBreaker, RamAccounting ramAccounting, List<DataType<?>> leftSideColumnTypes, long estimatedRowsSizeLeft, long estimatedNumberOfRowsLeft, boolean blockNestedLoop) {
    if (blockNestedLoop) {
        IntSupplier blockSizeCalculator = new RamBlockSizeCalculator(Paging.PAGE_SIZE, circuitBreaker, estimatedRowsSizeLeft, estimatedNumberOfRowsLeft);
        var rowAccounting = new RowCellsAccountingWithEstimators(leftSideColumnTypes, ramAccounting, 0);
        return new CrossJoinBlockNLBatchIterator(left, right, combiner, blockSizeCalculator, rowAccounting);
    } else {
        return new CrossJoinNLBatchIterator<>(left, right, combiner);
    }
}
Also used : RowCellsAccountingWithEstimators(io.crate.breaker.RowCellsAccountingWithEstimators) CrossJoinNLBatchIterator(io.crate.data.join.CrossJoinNLBatchIterator) IntSupplier(java.util.function.IntSupplier) CrossJoinBlockNLBatchIterator(io.crate.data.join.CrossJoinBlockNLBatchIterator)

Aggregations

RowCellsAccountingWithEstimators (io.crate.breaker.RowCellsAccountingWithEstimators)1 CrossJoinBlockNLBatchIterator (io.crate.data.join.CrossJoinBlockNLBatchIterator)1 CrossJoinNLBatchIterator (io.crate.data.join.CrossJoinNLBatchIterator)1 IntSupplier (java.util.function.IntSupplier)1