@Test
public void flattenPlan() throws Throwable{
DrillConfig config = DrillConfig.create();
LogicalPlan plan = LogicalPlan.parse(config, Files.toString(FileUtils.getResourceAsFile("/simple_plan_flattened.json"), Charsets.UTF_8));
IteratorRegistry ir = new IteratorRegistry();
ReferenceInterpreter i = new ReferenceInterpreter(plan, ir, new BasicEvaluatorFactory(ir), new RSERegistry(config));
i.setup();
Collection<RunOutcome> outcomes = i.run();
assertEquals(outcomes.size(), 1);
RunOutcome out = outcomes.iterator().next();
if(out.outcome != OutcomeType.FAILED && out.exception != null) logger.error("Failure while running {}", out.exception);