Search in sources :

Example 1 with AbstractColumnWriter

use of org.apache.drill.exec.vector.accessor.impl.AbstractColumnWriter in project drill by apache.

the class DirectRowSet method buildWriter.

/**
   * Build writer objects for each column based on the column type.
   *
   * @param rowIndex the index which points to each row
   * @return an array of writers
   */
protected RowSetWriter buildWriter(ExtendableRowIndex rowIndex) {
    ValueVector[] valueVectors = vectors();
    AbstractColumnWriter[] writers = new AbstractColumnWriter[valueVectors.length];
    for (int i = 0; i < writers.length; i++) {
        writers[i] = ColumnAccessorFactory.newWriter(valueVectors[i].getField().getType());
        writers[i].bind(rowIndex, valueVectors[i]);
    }
    TupleSchema accessSchema = schema().hierarchicalAccess();
    return new RowSetWriterImpl(this, accessSchema, rowIndex, writers);
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) AbstractColumnWriter(org.apache.drill.exec.vector.accessor.impl.AbstractColumnWriter) TupleSchema(org.apache.drill.exec.vector.accessor.TupleAccessor.TupleSchema)

Aggregations

ValueVector (org.apache.drill.exec.vector.ValueVector)1 TupleSchema (org.apache.drill.exec.vector.accessor.TupleAccessor.TupleSchema)1 AbstractColumnWriter (org.apache.drill.exec.vector.accessor.impl.AbstractColumnWriter)1