if (lookupSourceSupplier == null) {
OperatorFactory ordersTableScan = createTableScanOperator(0, "orders", "orderkey", "totalprice");
HashBuilderOperatorFactory hashBuilder = new HashBuilderOperatorFactory(1, ordersTableScan.getTypes(), Ints.asList(0), 1_500_000);
DriverContext driverContext = taskContext.addPipelineContext(false, false).addDriverContext();
Driver driver = new DriverFactory(false, false, ordersTableScan, hashBuilder).createDriver(driverContext);
while (!driver.isFinished()) {
driver.process();
}
lookupSourceSupplier = hashBuilder.getLookupSourceSupplier();
}
OperatorFactory lineItemTableScan = createTableScanOperator(0, "lineitem", "orderkey", "quantity");
OperatorFactory joinOperator = LookupJoinOperators.innerJoin(1, lookupSourceSupplier, lineItemTableScan.getTypes(), Ints.asList(0));
NullOutputOperatorFactory output = new NullOutputOperatorFactory(2, joinOperator.getTypes());
DriverFactory driverFactory = new DriverFactory(true, true, lineItemTableScan, joinOperator, output);
DriverContext driverContext = taskContext.addPipelineContext(true, true).addDriverContext();
Driver driver = driverFactory.createDriver(driverContext);
return ImmutableList.of(driver);
}