Examples of unparse()


Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

  private void parseAndRunLogicalPlan(String json) {
   
    try {
      LogicalPlan logicalPlan = context.getPlanReader().readLogicalPlan(json);
      if(logger.isDebugEnabled()) logger.debug("Logical {}", logicalPlan.unparse(context.getConfig()));
      PhysicalPlan physicalPlan = convert(logicalPlan);
      if(logger.isDebugEnabled()) logger.debug("Physical {}", context.getConfig().getMapper().writeValueAsString(physicalPlan));
      runPhysicalPlan(physicalPlan);
    } catch (IOException e) {
      fail("Failure while parsing logical plan.", e);
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

    @Test
    public void parseSimplePlan() throws Exception{
        DrillConfig c = DrillConfig.create();
        LogicalPlan plan = LogicalPlan.parse(c, FileUtils.getResourceAsString("/scan_screen_logical.json"));
        System.out.println(plan.unparse(c));
        //System.out.println( new BasicOptimizer(DrillConfig.create()).convert(plan).unparse(c.getMapper().writer()));
    }
}
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

      LogicalPlan logicalPlan = context.getPlanReader().readLogicalPlan(json);

      if(logicalPlan.getProperties().resultMode == ResultMode.LOGICAL){
        fail("Failure running plan.  You requested a result mode of LOGICAL and submitted a logical plan.  In this case you're output mode must be PHYSICAL or EXEC.", new Exception());
      }
      if(logger.isDebugEnabled()) logger.debug("Logical {}", logicalPlan.unparse(context.getConfig()));
      PhysicalPlan physicalPlan = convert(logicalPlan);

      if(logicalPlan.getProperties().resultMode == ResultMode.PHYSICAL){
        returnPhysical(physicalPlan);
        return;
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

    @Test
    public void parseSimplePlan() throws Exception{
        DrillConfig c = DrillConfig.create();
        LogicalPlan plan = LogicalPlan.parse(c, FileUtils.getResourceAsString("/scan_screen_logical.json"));
        System.out.println(plan.unparse(c));
        //System.out.println( new BasicOptimizer(DrillConfig.create()).convert(plan).unparse(c.getMapper().writer()));
    }
}
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

    public LogicalExplain(RelNode node, SqlExplainLevel level, QueryContext context){
      this.text = RelOptUtil.toString(node, level);
      DrillImplementor implementor = new DrillImplementor(new DrillParseContext(), ResultMode.LOGICAL);
      implementor.go( (DrillRel) node);
      LogicalPlan plan = implementor.getPlan();
      this.json = plan.unparse(context.getConfig());
    }
  }

  public static class PhysicalExplain{
    public String text;
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

      if (logicalPlan.getProperties().resultMode == ResultMode.LOGICAL) {
        fail("Failure running plan.  You requested a result mode of LOGICAL and submitted a logical plan.  In this case you're output mode must be PHYSICAL or EXEC.", new Exception());
      }
      if (logger.isDebugEnabled()) {
        logger.debug("Logical {}", logicalPlan.unparse(context.getConfig()));
      }
      PhysicalPlan physicalPlan = convert(logicalPlan);

      if (logicalPlan.getProperties().resultMode == ResultMode.PHYSICAL) {
        returnPhysical(physicalPlan);
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

    public LogicalExplain(RelNode node, SqlExplainLevel level, QueryContext context) {
      this.text = RelOptUtil.toString(node, level);
      DrillImplementor implementor = new DrillImplementor(new DrillParseContext(), ResultMode.LOGICAL);
      implementor.go( (DrillRel) node);
      LogicalPlan plan = implementor.getPlan();
      this.json = plan.unparse(context.getConfig());
    }
  }

  public static class PhysicalExplain{
    public String text;
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

    public LogicalExplain(RelNode node, SqlExplainLevel level, QueryContext context){
      this.text = RelOptUtil.toString(node, level);
      DrillImplementor implementor = new DrillImplementor(new DrillParseContext(), ResultMode.LOGICAL);
      implementor.go( (DrillRel) node);
      LogicalPlan plan = implementor.getPlan();
      this.json = plan.unparse(context.getConfig());
    }
  }

  public static class PhysicalExplain{
    public String text;
View Full Code Here

Examples of org.apache.drill.common.logical.LogicalPlan.unparse()

      LogicalPlan logicalPlan = context.getPlanReader().readLogicalPlan(json);

      if(logicalPlan.getProperties().resultMode == ResultMode.LOGICAL){
        fail("Failure running plan.  You requested a result mode of LOGICAL and submitted a logical plan.  In this case you're output mode must be PHYSICAL or EXEC.", new Exception());
      }
      if(logger.isDebugEnabled()) logger.debug("Logical {}", logicalPlan.unparse(context.getConfig()));
      PhysicalPlan physicalPlan = convert(logicalPlan);

      if(logicalPlan.getProperties().resultMode == ResultMode.PHYSICAL){
        returnPhysical(physicalPlan);
        return;
View Full Code Here

Examples of org.apache.drill.exec.physical.PhysicalPlan.unparse()

    DrillConfig c = DrillConfig.create();
    PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance());
    ObjectReader r = c.getMapper().reader(PhysicalPlan.class);
    ObjectWriter writer = c.getMapper().writer();
    PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/physical_test1.json"), Charsets.UTF_8));
    System.out.println(plan.unparse(writer));
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.