Package org.apache.drill.exec.ref.eval

Examples of org.apache.drill.exec.ref.eval.BasicEvaluatorFactory


  @Test
  public void parseSimplePlan() throws Throwable{
    DrillConfig config = DrillConfig.create();
    LogicalPlan plan = LogicalPlan.parse(config, Files.toString(FileUtils.getResourceAsFile("/simple_plan.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);
    assertEquals(outcomes.iterator().next().records, 2);
  }
View Full Code Here


  @Test
  public void joinPlan() throws Throwable{
    DrillConfig config = DrillConfig.create();
    LogicalPlan plan = LogicalPlan.parse(config, Files.toString(FileUtils.getResourceAsFile("/simple_join.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);
View Full Code Here

  @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);
View Full Code Here

      "{id: 3, name: \"larry\"}" +
      "{id: 4, name: \"fred\"}";

  private LimitROP buildROP(Limit l) {
    LimitROP limitROP = new LimitROP(l);
    limitROP.setupEvals(new BasicEvaluatorFactory(new IteratorRegistry()));
    return limitROP;
  }
View Full Code Here

            org.junit.Assert.assertEquals("Edge between constant operator and sink not recognized.",
                    plan.getGraph().getRoots().toString(), "[Store [memo=output sink]]");

           
            IteratorRegistry ir = new IteratorRegistry();
            ReferenceInterpreter i = new ReferenceInterpreter(plan, ir, new BasicEvaluatorFactory(ir), new RSERegistry(config));
            i.setup();
            Collection<RunOutcome> outcomes = i.run();

            for(RunOutcome outcome : outcomes){
                System.out.println("============");
View Full Code Here

   * @throws IOException
   */
  public static Collection<RunOutcome> getOutcome(DrillConfig config, String resourcePath) throws IOException{
    LogicalPlan plan = LogicalPlan.parse(config, Files.toString(FileUtils.getResourceAsFile(resourcePath), Charsets.UTF_8));
    IteratorRegistry ir = new IteratorRegistry();
    ReferenceInterpreter i = new ReferenceInterpreter(plan, ir, new BasicEvaluatorFactory(ir), new RSERegistry(config));
    i.setup();
    return i.run();
  }
View Full Code Here

    } else {
      planString = Files.toString(new File(jsonFile), Charsets.UTF_8);
    }
    LogicalPlan plan = LogicalPlan.parse(config, planString);
    IteratorRegistry ir = new IteratorRegistry();
    ReferenceInterpreter i = new ReferenceInterpreter(plan, ir, new BasicEvaluatorFactory(ir), new RSERegistry(config));
    i.setup();
    final Object[] result = {null};
    final Thread thread;
    if (queue != null) {
      thread = new Thread(
View Full Code Here

  /** Runs the plan as a background task. */
  Future<Collection<RunOutcome>> runPlan(CompletionService<Collection<RunOutcome>> service) {
    IteratorRegistry ir = new IteratorRegistry();
    DrillConfig config = DrillConfig.create();
    config.setSinkQueues(0, queue);
    final ReferenceInterpreter i = new ReferenceInterpreter(plan, ir, new BasicEvaluatorFactory(ir), new RSERegistry(
        config));
    try {
      i.setup();
    } catch (IOException e) {
      logger.error("IOException during query", e);
View Full Code Here

  Future<Collection<RunOutcome>> runRefInterpreterPlan(CompletionService<Collection<RunOutcome>> service) {
    LogicalPlan parsedPlan = LogicalPlan.parse(DrillConfig.create(), plan);
    IteratorRegistry ir = new IteratorRegistry();
    DrillConfig config = DrillConfig.create();
    config.setSinkQueues(0, queue);
    final ReferenceInterpreter i = new ReferenceInterpreter(parsedPlan, ir, new BasicEvaluatorFactory(ir),
        new RSERegistry(config));
    try {
      i.setup();
    } catch (IOException e) {
      throw new RuntimeException(e);
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.ref.eval.BasicEvaluatorFactory

Copyright © 2018 www.massapicom. 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.