Search in sources :

Example 1 with VectorDescrip

use of org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip 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 VectorDescrip

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

the class BaseReaderBuilder method buildContainerChildren.

protected AbstractObjectReader[] buildContainerChildren(VectorContainer container, MetadataProvider mdProvider) {
    List<AbstractObjectReader> readers = new ArrayList<>();
    for (int i = 0; i < container.getNumberOfColumns(); i++) {
        VectorWrapper<?> vw = container.getValueVector(i);
        VectorDescrip descrip = new VectorDescrip(mdProvider, i, vw.getField());
        readers.add(buildVectorReader(vw, descrip));
    }
    return readers.toArray(new AbstractObjectReader[readers.size()]);
}
Also used : AbstractObjectReader(org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader) ArrayList(java.util.ArrayList) VectorDescrip(org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip)

Example 3 with VectorDescrip

use of org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip 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 4 with VectorDescrip

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

the class BaseWriterBuilder method buildContainerChildren.

protected List<AbstractObjectWriter> buildContainerChildren(VectorContainer container, MetadataProvider mdProvider) {
    List<AbstractObjectWriter> 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(buildVectorWriter(vector, descrip));
    }
    return writers;
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) ArrayList(java.util.ArrayList) VectorDescrip(org.apache.drill.exec.physical.rowSet.model.MetadataProvider.VectorDescrip) AbstractObjectWriter(org.apache.drill.exec.vector.accessor.writer.AbstractObjectWriter)

Example 5 with VectorDescrip

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

Aggregations

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