@Override
public PhysicalOperator visitScan(Scan scan, Object obj) throws OptimizerException {
StorageEngineConfig config = logicalPlan.getStorageEngineConfig(scan.getStorageEngine());
if(config == null) throw new OptimizerException(String.format("Logical plan referenced the storage engine config %s but the logical plan didn't have that available as a config.", scan.getStorageEngine()));
StorageEngine engine;
try {
engine = context.getStorageEngine(config);
return engine.getPhysicalScan(scan);
} catch (IOException | ExecutionSetupException e) {
throw new OptimizerException("Failure while attempting to retrieve storage engine.", e);
}
}