use of org.apache.drill.exec.physical.resultSet.impl.TupleState.SingleMapState 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