Search in sources :

Example 1 with DummyArrayWriter

use of org.apache.drill.exec.vector.accessor.writer.dummy.DummyArrayWriter 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);
}
Also used : ArrayMapWriter(org.apache.drill.exec.vector.accessor.writer.MapWriter.ArrayMapWriter) DummyArrayMapWriter(org.apache.drill.exec.vector.accessor.writer.MapWriter.DummyArrayMapWriter) SingleMapWriter(org.apache.drill.exec.vector.accessor.writer.MapWriter.SingleMapWriter) DummyMapWriter(org.apache.drill.exec.vector.accessor.writer.MapWriter.DummyMapWriter) DummyArrayWriter(org.apache.drill.exec.vector.accessor.writer.dummy.DummyArrayWriter) ArrayObjectWriter(org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter.ArrayObjectWriter) ArrayMapWriter(org.apache.drill.exec.vector.accessor.writer.MapWriter.ArrayMapWriter) DummyArrayMapWriter(org.apache.drill.exec.vector.accessor.writer.MapWriter.DummyArrayMapWriter) DummyArrayMapWriter(org.apache.drill.exec.vector.accessor.writer.MapWriter.DummyArrayMapWriter) TupleObjectWriter(org.apache.drill.exec.vector.accessor.writer.AbstractTupleWriter.TupleObjectWriter)

Example 2 with DummyArrayWriter

use of org.apache.drill.exec.vector.accessor.writer.dummy.DummyArrayWriter in project drill by apache.

the class ObjectDictWriter method buildDictArray.

public static ArrayObjectWriter buildDictArray(ColumnMetadata metadata, RepeatedDictVector vector, List<AbstractObjectWriter> keyValueWriters) {
    final DictVector dataVector;
    if (vector != null) {
        dataVector = (DictVector) vector.getDataVector();
    } else {
        dataVector = null;
    }
    ObjectDictWriter.DictObjectWriter dictWriter = buildDict(metadata, dataVector, keyValueWriters);
    AbstractArrayWriter arrayWriter;
    if (vector != null) {
        arrayWriter = new ObjectArrayWriter(metadata, vector.getOffsetVector(), dictWriter);
    } else {
        arrayWriter = new DummyArrayWriter(metadata, dictWriter);
    }
    return new ArrayObjectWriter(arrayWriter);
}
Also used : DictVector(org.apache.drill.exec.vector.complex.DictVector) RepeatedDictVector(org.apache.drill.exec.vector.complex.RepeatedDictVector) DummyArrayWriter(org.apache.drill.exec.vector.accessor.writer.dummy.DummyArrayWriter)

Example 3 with DummyArrayWriter

use of org.apache.drill.exec.vector.accessor.writer.dummy.DummyArrayWriter in project drill by apache.

the class MapWriter method buildMapArray.

public static ArrayObjectWriter buildMapArray(ColumnMetadata schema, RepeatedMapVector mapVector, List<AbstractObjectWriter> writers) {
    MapWriter mapWriter;
    if (mapVector != null) {
        mapWriter = new ArrayMapWriter(schema, writers);
    } else {
        mapWriter = new DummyArrayMapWriter(schema, writers);
    }
    TupleObjectWriter mapArray = new TupleObjectWriter(mapWriter);
    AbstractArrayWriter arrayWriter;
    if (mapVector != null) {
        arrayWriter = new ObjectArrayWriter(schema, mapVector.getOffsetVector(), mapArray);
    } else {
        arrayWriter = new DummyArrayWriter(schema, mapArray);
    }
    return new ArrayObjectWriter(arrayWriter);
}
Also used : DummyArrayWriter(org.apache.drill.exec.vector.accessor.writer.dummy.DummyArrayWriter) ArrayObjectWriter(org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter.ArrayObjectWriter)

Aggregations

DummyArrayWriter (org.apache.drill.exec.vector.accessor.writer.dummy.DummyArrayWriter)3 ArrayObjectWriter (org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter.ArrayObjectWriter)2 TupleObjectWriter (org.apache.drill.exec.vector.accessor.writer.AbstractTupleWriter.TupleObjectWriter)1 ArrayMapWriter (org.apache.drill.exec.vector.accessor.writer.MapWriter.ArrayMapWriter)1 DummyArrayMapWriter (org.apache.drill.exec.vector.accessor.writer.MapWriter.DummyArrayMapWriter)1 DummyMapWriter (org.apache.drill.exec.vector.accessor.writer.MapWriter.DummyMapWriter)1 SingleMapWriter (org.apache.drill.exec.vector.accessor.writer.MapWriter.SingleMapWriter)1 DictVector (org.apache.drill.exec.vector.complex.DictVector)1 RepeatedDictVector (org.apache.drill.exec.vector.complex.RepeatedDictVector)1