use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by apache.
the class HyperReaderBuilder method buildContainerChildren.
protected List<AbstractObjectReader> buildContainerChildren(VectorContainer container, TupleMetadata schema) {
List<AbstractObjectReader> readers = new ArrayList<>();
for (int i = 0; i < container.getNumberOfColumns(); i++) {
VectorWrapper<?> vw = container.getValueVector(i);
VectorAccessor va = new HyperVectorAccessor(vw);
readers.add(buildVectorReader(va, schema.metadata(i)));
}
return readers;
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by apache.
the class SimpleReaderBuilder method buildDict.
private AbstractObjectReader buildDict(ValueVector vector, VectorAccessor va, VectorDescrip descrip) {
boolean isArray = descrip.metadata.isArray();
DictVector dictVector;
VectorAccessor dictAccessor;
if (isArray) {
dictVector = (DictVector) ((RepeatedValueVector) vector).getDataVector();
dictAccessor = new SingleVectorAccessor(dictVector);
} else {
dictVector = (DictVector) vector;
dictAccessor = va;
}
List<AbstractObjectReader> readers = buildMapMembers(dictVector, descrip.childProvider());
AbstractObjectReader reader = DictReaderImpl.build(descrip.metadata, dictAccessor, readers);
if (!isArray) {
return reader;
}
return ArrayReaderImpl.buildTuple(descrip.metadata, va, reader);
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by apache.
the class SimpleReaderBuilder method buildMultiDList.
private AbstractObjectReader buildMultiDList(RepeatedListVector vector, VectorAccessor listAccessor, VectorDescrip listDescrip) {
final ValueVector child = vector.getDataVector();
if (child == null) {
throw new UnsupportedOperationException("No child vector for repeated list.");
}
final VectorDescrip childDescrip = new VectorDescrip(listDescrip.childProvider(), 0, child.getField());
final AbstractObjectReader elementReader = buildVectorReader(child, childDescrip);
return ArrayReaderImpl.buildRepeatedList(listDescrip.metadata, listAccessor, elementReader);
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by axbaretto.
the class BaseReaderBuilder method buildContainerChildren.
protected List<AbstractObjectReader> buildContainerChildren(VectorContainer container, MetadataProvider mdProvider) {
List<AbstractObjectReader> writers = new ArrayList<>();
for (int i = 0; i < container.getNumberOfColumns(); i++) {
@SuppressWarnings("resource") ValueVector vector = container.getValueVector(i).getValueVector();
VectorDescrip descrip = new VectorDescrip(mdProvider, i, vector.getField());
writers.add(buildVectorReader(vector, descrip));
}
return writers;
}
use of org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader in project drill by apache.
the class SimpleReaderBuilder method buildMap.
private AbstractObjectReader buildMap(AbstractMapVector vector, VectorAccessor va, DataMode mode, VectorDescrip descrip) {
final boolean isArray = mode == DataMode.REPEATED;
// Map type
final AbstractObjectReader mapReader = MapReader.build(descrip.metadata, isArray ? null : va, buildMapMembers(vector, descrip.parent.childProvider(descrip.metadata)));
if (!isArray) {
return mapReader;
}
return ArrayReaderImpl.buildTuple(descrip.metadata, va, mapReader);
}
Aggregations