Examples of toErrorString()


Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

    assertEquals(1, newIfExpr.conditions.size());
    ifCondition = newIfExpr.conditions.get(0);
    assertEquals(bigIntType, ifCondition.expression.getMajorType());
    assertEquals(true, ((ValueExpressions.BooleanExpression) ifCondition.condition).value);
    if (ec.hasErrors())
      System.out.println(ec.toErrorString());
    assertFalse(ec.hasErrors());
  }

  @Test
  public void testMaterializingLateboundTreeValidated(final @Injectable RecordBatch batch) throws SchemaChangeException {
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

    assertTrue(newExpr instanceof FunctionCall);
    FunctionCall funcExpr = (FunctionCall) newExpr;
    assertEquals(1, funcExpr.args.size());
    assertEquals(bigIntType, funcExpr.args.get(0).getMajorType());
    assertEquals(1, ec.getErrorCount());
    System.out.println(ec.toErrorString());
  }
}
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

   
    for(OrderDef od : popConfig.getOrderings()){
      // first, we rewrite the evaluation stack for each side of the comparison.
      ErrorCollector collector = new ErrorCollectorImpl();
      final LogicalExpression expr = ExpressionTreeMaterializer.materialize(od.getExpr(), this, collector);
      if(collector.hasErrors()) throw new SchemaChangeException("Failure while materializing expression. " + collector.toErrorString());
      g.setMappingSet(LEFT_MAPPING);
      HoldingContainer left = g.addExpr(expr, false);
      g.setMappingSet(RIGHT_MAPPING);
      HoldingContainer right = g.addExpr(expr, false);
      g.setMappingSet(MAIN_MAPPING);
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

      allocators.add(VectorAllocator.getAllocator(vector, 50));
      TypedFieldId id = container.add(vector);
      valueExprs[i] = new ValueVectorWriteExpression(id, expr, true);
    }
   
    if(collector.hasErrors()) throw new SchemaChangeException("Failure while materializing expression. " + collector.toErrorString());
   
    setupIsSame(cg, keyExprs);
    setupIsSameApart(cg, keyExprs);
    addRecordValues(cg, valueExprs);
    outputRecordKeys(cg, keyOutputIds, keyExprs);
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

    // materialize value vector readers from join expression
    final LogicalExpression materializedLeftExpr = ExpressionTreeMaterializer.materialize(leftFieldExpr, left, collector);
    if (collector.hasErrors())
      throw new ClassTransformationException(String.format(
          "Failure while trying to materialize incoming left field.  Errors:\n %s.", collector.toErrorString()));

    final LogicalExpression materializedRightExpr = ExpressionTreeMaterializer.materialize(rightFieldExpr, right, collector);
    if (collector.hasErrors())
      throw new ClassTransformationException(String.format(
          "Failure while trying to materialize incoming right field.  Errors:\n %s.", collector.toErrorString()));
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

          "Failure while trying to materialize incoming left field.  Errors:\n %s.", collector.toErrorString()));

    final LogicalExpression materializedRightExpr = ExpressionTreeMaterializer.materialize(rightFieldExpr, right, collector);
    if (collector.hasErrors())
      throw new ClassTransformationException(String.format(
          "Failure while trying to materialize incoming right field.  Errors:\n %s.", collector.toErrorString()));


    // generate compare()
    ////////////////////////
    cg.setMappingSet(COMPARE_MAPPING);
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

    final List<TransferPair> transfers = Lists.newArrayList();
    final CodeGenerator<Filterer> cg = new CodeGenerator<Filterer>(Filterer.TEMPLATE_DEFINITION, context.getFunctionRegistry());
   
    final LogicalExpression expr = ExpressionTreeMaterializer.materialize(filterExpression, incoming, collector);
    if(collector.hasErrors()){
      throw new SchemaChangeException(String.format("Failure while trying to materialize incoming schema.  Errors:\n %s.", collector.toErrorString()));
    }
   
    cg.addExpr(new ReturnValueExpression(expr));
   
    for(VectorWrapper<?> v : incoming){
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

    final ErrorCollector collector = new ErrorCollectorImpl();
    final CodeGenerator<Partitioner> cg = new CodeGenerator<Partitioner>(Partitioner.TEMPLATE_DEFINITION, context.getFunctionRegistry());

    final LogicalExpression expr = ExpressionTreeMaterializer.materialize(filterExpression, incoming, collector);
    if(collector.hasErrors()){
      throw new SchemaChangeException(String.format("Failure while trying to materialize incoming schema.  Errors:\n %s.", collector.toErrorString()));
    }

    cg.addExpr(new ReturnValueExpression(expr));
   
    try {
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

    final LogicalExpression materializedExpr = ExpressionTreeMaterializer.materialize(expr, incoming, collector);
    if (collector.hasErrors()) {
      throw new SchemaChangeException(String.format(
          "Failure while trying to materialize incoming schema.  Errors:\n %s.",
          collector.toErrorString()));
    }

    // generate code to copy from an incoming value vector to the destination partition's outgoing value vector
    JExpression inIndex = JExpr.direct("inIndex");
    JExpression bucket = JExpr.direct("bucket");
View Full Code Here

Examples of org.apache.drill.common.expression.ErrorCollector.toErrorString()

    for(int i =0; i < exprs.size(); i++){
      final NamedExpression namedExpression = exprs.get(i);
      final LogicalExpression expr = ExpressionTreeMaterializer.materialize(namedExpression.getExpr(), incoming, collector);
      final MaterializedField outputField = MaterializedField.create(getRef(namedExpression), expr.getMajorType());
      if(collector.hasErrors()){
        throw new SchemaChangeException(String.format("Failure while trying to materialize incoming schema.  Errors:\n %s.", collector.toErrorString()));
      }
     
      // add value vector to transfer if direct reference and this is allowed, otherwise, add to evaluation stack.
      if(expr instanceof ValueVectorReadExpression && incoming.getSchema().getSelectionVectorMode() == SelectionVectorMode.NONE){
        ValueVectorReadExpression vectorRead = (ValueVectorReadExpression) expr;
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.