use of org.apache.drill.exec.vector.accessor.writer.AbstractTupleWriter.TupleObjectWriter in project drill by axbaretto.
the class ColumnWriterFactory method buildMapArray.
public static ArrayObjectWriter buildMapArray(ColumnMetadata schema, UInt4Vector offsetVector, List<AbstractObjectWriter> writers) {
MapWriter mapWriter;
if (schema.isProjected()) {
mapWriter = new ArrayMapWriter(schema, writers);
} else {
mapWriter = new DummyArrayMapWriter(schema, writers);
}
TupleObjectWriter mapArray = new TupleObjectWriter(schema, mapWriter);
AbstractArrayWriter arrayWriter;
if (schema.isProjected()) {
arrayWriter = new ObjectArrayWriter(offsetVector, mapArray);
} else {
arrayWriter = new DummyArrayWriter(mapArray);
}
return new ArrayObjectWriter(schema, arrayWriter);
}
use of org.apache.drill.exec.vector.accessor.writer.AbstractTupleWriter.TupleObjectWriter in project drill by apache.
the class ColumnBuilder method buildSingleMap.
private ColumnState buildSingleMap(ContainerState parent, ColumnMetadata columnSchema) {
final ProjectionFilter projFilter = parent.projection();
final ProjResult projResult = projFilter.projection(columnSchema);
final MapVector vector;
final VectorState vectorState;
if (projResult.isProjected) {
// vectors can be cached.
assert columnSchema.tupleSchema().isEmpty();
vector = new MapVector(columnSchema.schema(), parent.loader().allocator(), null);
vectorState = new MapVectorState(vector, new NullVectorState());
} else {
vector = null;
vectorState = new NullVectorState();
}
final TupleObjectWriter mapWriter = MapWriter.buildMap(columnSchema, vector, new ArrayList<>());
final SingleMapState mapState = new SingleMapState(parent.loader(), parent.vectorCache().childCache(columnSchema.name()), projResult.mapFilter);
return new MapColumnState(mapState, mapWriter, vectorState, parent.isVersioned());
}
Aggregations