use of org.apache.drill.exec.vector.complex.AbstractMapVector in project drill by axbaretto.
the class HyperVectorWrapper method getChildWrapper.
@SuppressWarnings("resource")
@Override
public VectorWrapper<?> getChildWrapper(int[] ids) {
if (ids.length == 1) {
return this;
}
ValueVector[] vectors = new ValueVector[this.vectors.length];
int index = 0;
for (ValueVector v : this.vectors) {
ValueVector vector = v;
for (int i = 1; i < ids.length; i++) {
final AbstractMapVector mapLike = AbstractMapVector.class.cast(vector);
if (mapLike == null) {
return null;
}
vector = mapLike.getChildByOrdinal(ids[i]);
}
vectors[index] = vector;
index++;
}
return new HyperVectorWrapper<ValueVector>(vectors[0].getField(), vectors);
}
use of org.apache.drill.exec.vector.complex.AbstractMapVector in project drill by apache.
the class BuildVectorsFromMetadata method buildMap.
/**
* Build a map column including the members of the map given a map
* column schema.
*
* @param schema the schema of the map column
* @return the completed map vector column model
*/
private AbstractMapVector buildMap(ColumnMetadata schema) {
// Creating the map vector will create its contained vectors if we
// give it a materialized field with children. So, instead pass a clone
// without children so we can add the children as we add vectors.
final AbstractMapVector mapVector = (AbstractMapVector) TypeHelper.getNewVector(schema.emptySchema(), allocator, null);
populateMap(mapVector, schema.tupleSchema(), false);
return mapVector;
}
Aggregations