Examples of MaterializedField


Examples of org.apache.drill.exec.record.MaterializedField

    final CodeGenerator<Projector> cg = new CodeGenerator<Projector>(Projector.TEMPLATE_DEFINITION, context.getFunctionRegistry());
   
    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.
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

public class TestAdaptiveAllocation {

  @Test
  public void test() throws Exception {
    BufferAllocator allocator = new TopLevelAllocator();
    MaterializedField field = MaterializedField.create("field", Types.required(MinorType.VARCHAR));
    NullableVarBinaryVector vector1 = new NullableVarBinaryVector(field, allocator);
    NullableVarCharVector vector2 = new NullableVarCharVector(field, allocator);
    NullableBigIntVector vector3 = new NullableBigIntVector(field, allocator);

    Random rand = new Random();
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

    throw new UnsupportedOperationException();
  }
 
  public static ValueVector getNewVector(SchemaPath parentPath, String name, BufferAllocator allocator, MajorType type){
    SchemaPath child = parentPath.getChild(name);
    MaterializedField field = MaterializedField.create(child, type);
    return getNewVector(field, allocator);
  }
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

    MajorType.Builder typeBuilder = MajorType.newBuilder();
    typeBuilder
        .setMinorType(MinorType.UINT4)
        .setMode(DataMode.REQUIRED)
        .setWidth(4);
        MaterializedField field = MaterializedField.create(SchemaPath.getSimplePath(""), typeBuilder.build());

    // Create a new value vector for 1024 integers
    UInt4Vector v = new UInt4Vector(field, allocator);
    UInt4Vector.Mutator m = v.getMutator();
    v.allocateNew(1024);
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

        .setMinorType(MinorType.VARCHAR)
        .setMode(DataMode.OPTIONAL)
        .setWidth(2);
    defBuilder
        .setMajorType(typeBuilder.build());
    MaterializedField field = MaterializedField.create(defBuilder.build());

    // Create a new value vector for 1024 integers
    NullableVarCharVector v = new NullableVarCharVector(field, allocator);
    NullableVarCharVector.Mutator m = v.getMutator();
    v.allocateNew(1024*10, 1024);
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

        .setMinorType(MinorType.UINT4)
        .setMode(DataMode.OPTIONAL)
        .setWidth(4);
    defBuilder
        .setMajorType(typeBuilder.build());
    MaterializedField field = MaterializedField.create(defBuilder.build());

    // Create a new value vector for 1024 integers
    NullableUInt4Vector v = new NullableUInt4Vector(field, allocator);
    NullableUInt4Vector.Mutator m = v.getMutator();
    v.allocateNew(1024);
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

        .setMinorType(MinorType.FLOAT4)
        .setMode(DataMode.OPTIONAL)
        .setWidth(4);
    defBuilder
        .setMajorType(typeBuilder.build());
    MaterializedField field = MaterializedField.create(defBuilder.build());

    // Create a new value vector for 1024 integers
    NullableFloat4Vector v = (NullableFloat4Vector) TypeHelper.getNewVector(field, allocator);
    NullableFloat4Vector.Mutator m = v.getMutator();
    v.allocateNew(1024);
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

        .setMinorType(MinorType.BIT)
        .setMode(DataMode.REQUIRED)
        .setWidth(4);
    defBuilder
        .setMajorType(typeBuilder.build());
    MaterializedField field = MaterializedField.create(defBuilder.build());

    // Create a new value vector for 1024 integers
    BitVector v = new BitVector(field, allocator);
    BitVector.Mutator m = v.getMutator();
    v.allocateNew(1024);
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

    }
    List<ValueVector> vectorList = Lists.newArrayList();
    List<SerializedField> fieldList = batchDef.getFieldList();
    for (SerializedField metaData : fieldList) {
      int dataLength = metaData.getBufferLength();
      MaterializedField field = MaterializedField.create(metaData);
      ByteBuf buf = allocator.buffer(dataLength);
      buf.writeBytes(input, dataLength);
      ValueVector vector = TypeHelper.getNewVector(field, allocator);
      vector.load(metaData, buf);
      buf.release();
View Full Code Here

Examples of org.apache.drill.exec.record.MaterializedField

    this.mapKey = String.format("%s_%d", context.getHandle().getQueryId(), context.getHandle().getMajorFragmentId());
    this.minorFragmentSampleCount = cache.getCounter(mapKey);

    SchemaPath outputPath = popConfig.getRef();
    MaterializedField outputField = MaterializedField.create(outputPath, Types.required(TypeProtos.MinorType.INT));
    this.partitionKeyVector = (IntVector) TypeHelper.getNewVector(outputField, oContext.getAllocator());

  }
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.