Examples of BasicEvaluator


Examples of org.apache.drill.exec.ref.eval.EvaluatorTypes.BasicEvaluator

    int i = nameToPosition.lget();
    return getEvaluator(i);
  }
 
  public BasicEvaluator getEvaluator(int argIndex){
    BasicEvaluator eval = ev.get(argIndex);
    if(eval == null) throw new RuntimeException("Unknown Item provided.");
    return eval;
   
  }
View Full Code Here

Examples of org.apache.drill.exec.ref.eval.EvaluatorTypes.BasicEvaluator

  public static BasicEvaluator getEvaluator(String name, FunctionArguments args, RecordPointer record) {
    Constructor<? extends BasicEvaluator> c = map.get(name);
    if (c == null) throw new SetupException(String.format("Unable to find requested basic evaluator %s.", name));
    try {
      try {
        BasicEvaluator e = c.newInstance(record, args);
        return e;
      } catch (InvocationTargetException e) {
        Throwable ex = e.getCause();
        if (ex instanceof SetupException) {
          throw (SetupException) ex;
        } else {
          if(ex instanceof RuntimeException){
            throw (RuntimeException) ex;
View Full Code Here

Examples of org.apache.drill.exec.ref.eval.EvaluatorTypes.BasicEvaluator

 
  @Override
  public AggregatingEvaluator getAggregatingOperator(RecordPointer record, LogicalExpression e) {
    SimpleEvaluationVisitor visitor = new SimpleEvaluationVisitor(record);
    BasicEvaluator b = e.accept(visitor, null);
    return new AggregatingWrapperEvaluator(visitor.getAggregators(), b);
  }
View Full Code Here

Examples of org.apache.drill.exec.ref.eval.EvaluatorTypes.BasicEvaluator

    }
    FunctionArguments args = new FunctionArguments(onlyConstants, includesAggregates, evals, call);

    if(call.getDefinition().isAggregating()){
      if(args.includesAggregates()) throw new SetupException(String.format("The call for %s contains one or more arguments that also contain aggregating functions.  An aggregating function cannot contain aggregating expressions.", call.getDefinition()));
      BasicEvaluator e = FunctionEvaluatorRegistry.getEvaluator(call.getDefinition().getName(), args, record);
      if(!(e instanceof AggregatingEvaluator ) ){
        throw new SetupException(String.format("Function %s is an aggregating function.  However, the provided evaluator (%s) is not an aggregating evaluator.", call.getDefinition(), e.getClass()));
      }
     
      aggregators.add( (AggregatingEvaluator) e);
      return e;
    }else{
      BasicEvaluator e = FunctionEvaluatorRegistry.getEvaluator(call.getDefinition().getName(), args, record);
      return e;
    }
  }
View Full Code Here

Examples of org.apache.drill.exec.ref.eval.EvaluatorTypes.BasicEvaluator

    ExprParser parser = new ExprParser(tokens);
    LogicalExpression e = parser.parse().e;
    RecordPointer r = new UnbackedRecord();
    r.addField(new SchemaPath("a", ExpressionPosition.UNKNOWN), new IntegerScalar(3));
    SimpleEvaluationVisitor builder = new SimpleEvaluationVisitor(r);
    BasicEvaluator eval = e.accept(builder, null);
    DataValue v = eval.eval();
    System.out.println(v);
  }
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.