Search in sources :

Example 1 with MetadataProvider

use of org.apache.drill.exec.physical.rowSet.model.MetadataProvider 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;
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) AbstractObjectReader(org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader) MetadataProvider(org.apache.drill.exec.physical.rowSet.model.MetadataProvider) ArrayList(java.util.ArrayList) MaterializedField(org.apache.drill.exec.record.MaterializedField) HyperVectorWrapper(org.apache.drill.exec.record.HyperVectorWrapper) VectorDescrip(org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip)

Example 2 with MetadataProvider

use of org.apache.drill.exec.physical.rowSet.model.MetadataProvider 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;
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) AbstractObjectReader(org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader) MetadataProvider(org.apache.drill.exec.physical.rowSet.model.MetadataProvider) ArrayList(java.util.ArrayList) VectorDescrip(org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip)

Example 3 with MetadataProvider

use of org.apache.drill.exec.physical.rowSet.model.MetadataProvider in project drill by axbaretto.

the class VectorAllocator method allocateMap.

private void allocateMap(AbstractMapVector vector, ColumnMetadata metadata, int valueCount, MetadataProvider mdProvider) {
    MetadataProvider mapProvider = mdProvider.childProvider(metadata);
    TupleMetadata mapSchema = metadata.mapSchema();
    assert mapSchema != null;
    int i = 0;
    for (ValueVector child : vector) {
        allocateVector(child, mapProvider.metadata(i, child.getField()), valueCount, mapProvider);
        i++;
    }
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) MetadataProvider(org.apache.drill.exec.physical.rowSet.model.MetadataProvider) TupleMetadata(org.apache.drill.exec.record.metadata.TupleMetadata)

Example 4 with MetadataProvider

use of org.apache.drill.exec.physical.rowSet.model.MetadataProvider in project drill by axbaretto.

the class BaseWriterBuilder method buildMap.

private List<AbstractObjectWriter> buildMap(AbstractMapVector vector, VectorDescrip descrip) {
    List<AbstractObjectWriter> writers = new ArrayList<>();
    MetadataProvider provider = descrip.parent.childProvider(descrip.metadata);
    int i = 0;
    for (ValueVector child : vector) {
        VectorDescrip childDescrip = new VectorDescrip(provider, i, child.getField());
        writers.add(buildVectorWriter(child, childDescrip));
        i++;
    }
    return writers;
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) MetadataProvider(org.apache.drill.exec.physical.rowSet.model.MetadataProvider) ArrayList(java.util.ArrayList) VectorDescrip(org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip) AbstractObjectWriter(org.apache.drill.exec.vector.accessor.writer.AbstractObjectWriter)

Aggregations

MetadataProvider (org.apache.drill.exec.physical.rowSet.model.MetadataProvider)4 ValueVector (org.apache.drill.exec.vector.ValueVector)4 ArrayList (java.util.ArrayList)3 VectorDescrip (org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip)3 AbstractObjectReader (org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader)2 HyperVectorWrapper (org.apache.drill.exec.record.HyperVectorWrapper)1 MaterializedField (org.apache.drill.exec.record.MaterializedField)1 TupleMetadata (org.apache.drill.exec.record.metadata.TupleMetadata)1 AbstractObjectWriter (org.apache.drill.exec.vector.accessor.writer.AbstractObjectWriter)1