use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by axbaretto.
the class BaseReaderBuilder method buildMap.
private List<AbstractObjectReader> buildMap(HyperVectorWrapper<? extends AbstractMapVector> vectors, VectorDescrip descrip) {
List<AbstractObjectReader> readers = new ArrayList<>();
MetadataProvider provider = descrip.parent.childProvider(descrip.metadata);
MaterializedField mapField = vectors.getField();
for (int i = 0; i < mapField.getChildren().size(); i++) {
HyperVectorWrapper<? extends ValueVector> child = (HyperVectorWrapper<? extends ValueVector>) vectors.getChildWrapper(new int[] { i });
VectorDescrip childDescrip = new VectorDescrip(provider, i, child.getField());
readers.add(buildVectorReader(child, childDescrip));
i++;
}
return readers;
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by axbaretto.
the class BaseReaderBuilder method buildContainerChildren.
protected AbstractObjectReader[] buildContainerChildren(VectorContainer container, MetadataProvider mdProvider) {
List<AbstractObjectReader> readers = new ArrayList<>();
for (int i = 0; i < container.getNumberOfColumns(); i++) {
VectorWrapper<?> vw = container.getValueVector(i);
VectorDescrip descrip = new VectorDescrip(mdProvider, i, vw.getField());
readers.add(buildVectorReader(vw, descrip));
}
return readers.toArray(new AbstractObjectReader[readers.size()]);
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by axbaretto.
the class BaseReaderBuilder method buildMap.
private List<AbstractObjectReader> buildMap(AbstractMapVector vector, VectorDescrip descrip) {
List<AbstractObjectReader> readers = new ArrayList<>();
MetadataProvider provider = descrip.parent.childProvider(descrip.metadata);
int i = 0;
for (ValueVector child : vector) {
VectorDescrip childDescrip = new VectorDescrip(provider, i, child.getField());
readers.add(buildVectorReader(child, childDescrip));
i++;
}
return readers;
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by apache.
the class SimpleReaderBuilder method build.
public static RowSetReaderImpl build(VectorContainer container, ReaderIndex rowIndex) {
MetadataCreator mdCreator = new MetadataCreator();
List<AbstractObjectReader> children = INSTANCE.buildContainerChildren(container, mdCreator);
return new RowSetReaderImpl(mdCreator.tuple(), rowIndex, children);
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by apache.
the class HyperReaderBuilder method buildMap.
private AbstractObjectReader buildMap(VectorAccessor va, DataMode mode, ColumnMetadata metadata) {
boolean isArray = mode == DataMode.REPEATED;
// Map type
AbstractObjectReader mapReader = MapReader.build(metadata, isArray ? null : va, buildMapMembers(va, metadata.tupleSchema()));
if (!isArray) {
return mapReader;
}
return ArrayReaderImpl.buildTuple(metadata, va, mapReader);
}
Aggregations