{
DriverContext driverContext = taskContext.addPipelineContext(true, true).addDriverContext();
OperatorContext operatorContext = driverContext.addOperatorContext(0, ValuesOperator.class.getSimpleName());
JoinCompiler joinCompiler = new JoinCompiler();
ImmutableList<Type> types = ImmutableList.<Type>of(VARCHAR);
LookupSourceFactory lookupSourceFactoryFactory = joinCompiler.compileLookupSourceFactory(types, Ints.asList(0));
// crate hash strategy with a single channel blocks -- make sure there is some overlap in values
List<Block> channel = ImmutableList.of(
BlockAssertions.createStringSequenceBlock(10, 20),
BlockAssertions.createStringSequenceBlock(20, 30),
BlockAssertions.createStringSequenceBlock(15, 25));
LongArrayList addresses = new LongArrayList();
for (int blockIndex = 0; blockIndex < channel.size(); blockIndex++) {
Block block = channel.get(blockIndex);
for (int positionIndex = 0; positionIndex < block.getPositionCount(); positionIndex++) {
addresses.add(encodeSyntheticAddress(blockIndex, positionIndex));
}
}
LookupSource lookupSource = lookupSourceFactoryFactory.createLookupSource(addresses, types, ImmutableList.of(channel), operatorContext);
JoinProbeCompiler joinProbeCompiler = new JoinProbeCompiler();
JoinProbeFactory probeFactory = joinProbeCompiler.internalCompileJoinProbe(types, Ints.asList(0));
Page page = SequencePageBuilder.createSequencePage(types, 10, 10);