use of org.apache.drill.exec.vector.accessor.impl.AbstractColumnReader in project drill by apache.
the class AbstractSingleRowSet method buildReader.
/**
* Internal method to build the set of column readers needed for
* this row set. Used when building a row set reader.
* @param rowIndex object that points to the current row
* @return an array of column readers: in the same order as the
* (non-map) vectors.
*/
protected RowSetReader buildReader(RowSetIndex rowIndex) {
FlattenedSchema accessSchema = schema().flatAccess();
ValueVector[] valueVectors = vectors();
AbstractColumnReader[] readers = new AbstractColumnReader[valueVectors.length];
for (int i = 0; i < readers.length; i++) {
MinorType type = accessSchema.column(i).getType().getMinorType();
if (type == MinorType.MAP) {
// buildMapAccessor(i);
readers[i] = null;
} else if (type == MinorType.LIST) {
// buildListAccessor(i);
readers[i] = null;
} else {
readers[i] = ColumnAccessorFactory.newReader(valueVectors[i].getField().getType());
readers[i].bind(rowIndex, valueVectors[i]);
}
}
return new RowSetReaderImpl(accessSchema, rowIndex, readers);
}
use of org.apache.drill.exec.vector.accessor.impl.AbstractColumnReader in project drill by apache.
the class HyperRowSetImpl method buildReader.
/**
* Internal method to build the set of column readers needed for
* this row set. Used when building a row set reader.
* @param rowIndex object that points to the current row
* @return an array of column readers: in the same order as the
* (non-map) vectors.
*/
protected RowSetReader buildReader(HyperRowIndex rowIndex) {
FlattenedSchema accessSchema = schema().flatAccess();
AbstractColumnReader[] readers = new AbstractColumnReader[accessSchema.count()];
for (int i = 0; i < readers.length; i++) {
MaterializedField field = accessSchema.column(i);
readers[i] = ColumnAccessorFactory.newReader(field.getType());
HyperVectorWrapper<ValueVector> hvw = getHyperVector(i);
readers[i].bind(rowIndex, field, new HyperVectorAccessor(hvw, rowIndex));
}
return new RowSetReaderImpl(accessSchema, rowIndex, readers);
}
Aggregations