use of org.apache.drill.common.config.LogicalPlanPersistence in project drill by apache.
the class BasicOptimizerTest method parseSimplePlan.
@Test
public void parseSimplePlan() throws Exception {
DrillConfig c = DrillConfig.create();
LogicalPlanPersistence lpp = PhysicalPlanReaderTestFactory.defaultLogicalPlanPersistence(c);
LogicalPlan plan = LogicalPlan.parse(lpp, FileUtils.getResourceAsString("/scan_screen_logical.json"));
String unparse = plan.unparse(lpp);
// System.out.println(unparse);
//System.out.println( new BasicOptimizer(DrillConfig.create()).convert(plan).unparse(c.getMapper().writer()));
}
use of org.apache.drill.common.config.LogicalPlanPersistence in project drill by apache.
the class TestParsePhysicalPlan method parseSimplePlan.
@Test
public void parseSimplePlan() throws Exception {
DrillConfig c = DrillConfig.create();
ScanResult scanResult = ClassPathScanner.fromPrescan(c);
LogicalPlanPersistence lpp = new LogicalPlanPersistence(c, scanResult);
PhysicalPlanReader reader = new PhysicalPlanReader(c, scanResult, lpp, CoordinationProtos.DrillbitEndpoint.getDefaultInstance(), null);
ObjectReader r = lpp.getMapper().reader(PhysicalPlan.class);
ObjectWriter writer = lpp.getMapper().writer();
PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/physical_test1.json"), Charsets.UTF_8));
String unparse = plan.unparse(writer);
// System.out.println(unparse);
}
use of org.apache.drill.common.config.LogicalPlanPersistence in project drill by apache.
the class CheckStorageConfig method checkPlanParsing.
@Test
public void checkPlanParsing() throws Exception {
DrillConfig config = DrillConfig.create();
ScanResult scan = ClassPathScanner.fromPrescan(config);
LogicalPlan plan = LogicalPlan.parse(new LogicalPlanPersistence(config, scan), FileUtils.getResourceAsString("/storage_engine_plan.json"));
}
Aggregations