Package org.apache.drill.exec.exception

Examples of org.apache.drill.exec.exception.SchemaChangeException


      generateCopies(cg, false);
      Copier copier = context.getImplementationClass(cg);
      copier.setupRemover(context, incoming, this, allocators.toArray(new VectorAllocator[allocators.size()]));
      return copier;
    } catch (ClassTransformationException | IOException e) {
      throw new SchemaChangeException("Failure while attempting to load generated class", e);
    }
  }
View Full Code Here


      generateCopies(cg, true);
      Copier copier = context.getImplementationClass(cg);
      copier.setupRemover(context, incoming, this, allocators.toArray(new VectorAllocator[allocators.size()]));
      return copier;
    } catch (ClassTransformationException | IOException e) {
      throw new SchemaChangeException("Failure while attempting to load generated class", e);
    }
  }
View Full Code Here

  private final int recordCount;
  private int start;
  private int length;
 
  public SelectionVector4(ByteBuf vector, int recordCount, int batchRecordCount) throws SchemaChangeException {
    if(recordCount > Integer.MAX_VALUE /4) throw new SchemaChangeException(String.format("Currently, Drill can only support allocations up to 2gb in size.  You requested an allocation of %d bytes.", recordCount * 4));
    this.recordCount = recordCount;
    this.start = 0;
    this.length = Math.min(batchRecordCount, recordCount);
    this.vector = vector;
  }
View Full Code Here

//              "not currently contain that field id.  The offending fieldId was %d", fieldId));
//    setTypedField(fieldId, type, nullable, mode, valueClass);
//  }
 
  public SchemaBuilder removeField(MaterializedField f) throws SchemaChangeException{
    if(!fields.remove(f)) throw new SchemaChangeException("You attempted to remove an nonexistent field.");
    return this;
  }
View Full Code Here

   
    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

    return true;
  }

  public void build(FragmentContext context) throws SchemaChangeException{
    container.clear();
    if(batches.keySet().size() > 1) throw new SchemaChangeException("Sort currently only supports a single schema.");
    if(batches.size() > Character.MAX_VALUE) throw new SchemaChangeException("Sort cannot work on more than %d batches at a time.", (int) Character.MAX_VALUE);
    sv4 = new SelectionVector4(svAllocator.getAllocation(), recordCount, Character.MAX_VALUE);
    BatchSchema schema = batches.keySet().iterator().next();
    List<RecordBatchData> data = batches.get(schema);
   
    // now we're going to generate the sv4 pointers
View Full Code Here

      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

        try {
          logger.debug("Creating New Worker");
          this.worker = generateNewWorker();
          first = true;
        } catch (ClassTransformationException | IOException | SchemaChangeException e) {
          context.fail(new SchemaChangeException(e));
          kill();
          return IterOutcome.STOP;
        }
      }
View Full Code Here

    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){
      TransferPair pair = v.getValueVector().getTransferPair();
      container.add(pair.getTo());
      transfers.add(pair);
    }
   
    container.buildSchema(SelectionVectorMode.TWO_BYTE);
   
    try {
      TransferPair[] tx = transfers.toArray(new TransferPair[transfers.size()]);
      this.filter = context.getImplementationClass(cg);
      filter.setup(context, incoming, this, tx);
    } catch (ClassTransformationException | IOException e) {
      throw new SchemaChangeException("Failure while attempting to load generated class", e);
    }
  }
View Full Code Here

  private class Mutator implements OutputMutator {

    public void removeField(MaterializedField field) throws SchemaChangeException {
      ValueVector vector = fieldVectorMap.remove(field);
      if (vector == null) throw new SchemaChangeException("Failure attempting to remove an unknown field.");
      container.remove(vector);
      vector.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.exception.SchemaChangeException

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.