Package org.apache.drill.exec.ref.values.ScalarValues

Examples of org.apache.drill.exec.ref.values.ScalarValues.IntegerScalar


    case INT:
      int x = 0;
      for(int i =0; i < values.length; i++){
        x += values[i].getAsInt();
      }
      return new IntegerScalar(x);     
    case LONG:
      int l = 0;
      for(int i =0; i < values.length; i++){
        l += values[i].getAsLong();
      }
View Full Code Here


//        return new BigDecimalScalar(node.decimalValue());
      } else {
        return new DoubleScalar(node.asDouble());
      }
    } else if (node.isInt()) {
      return new IntegerScalar(node.asInt());
    } else if (node.isLong()) {
      return new LongScalar(node.asLong());
    } else if (node.isTextual()) {
      return new StringScalar(node.asText());
    } else {
View Full Code Here

    ExprLexer lexer = new ExprLexer(new ANTLRStringStream(expr));
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    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

Related Classes of org.apache.drill.exec.ref.values.ScalarValues.IntegerScalar

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.