Search in sources :

Example 1 with ColumnVector

use of org.apache.orc.storage.ql.exec.vector.ColumnVector in project incubator-gobblin by apache.

the class GobblinBaseOrcWriter method removeRefOfColumnVectorChild.

/**
 * Set the child field of {@link ColumnVector} to null, assuming input {@link ColumnVector} is nonNull.
 */
private void removeRefOfColumnVectorChild(ColumnVector cv) {
    if (cv instanceof StructColumnVector) {
        StructColumnVector structCv = (StructColumnVector) cv;
        for (ColumnVector childCv : structCv.fields) {
            removeRefOfColumnVectorChild(childCv);
        }
    } else if (cv instanceof ListColumnVector) {
        ListColumnVector listCv = (ListColumnVector) cv;
        removeRefOfColumnVectorChild(listCv.child);
    } else if (cv instanceof MapColumnVector) {
        MapColumnVector mapCv = (MapColumnVector) cv;
        removeRefOfColumnVectorChild(mapCv.keys);
        removeRefOfColumnVectorChild(mapCv.values);
    } else if (cv instanceof UnionColumnVector) {
        UnionColumnVector unionCv = (UnionColumnVector) cv;
        for (ColumnVector unionChildCv : unionCv.fields) {
            removeRefOfColumnVectorChild(unionChildCv);
        }
    } else if (cv instanceof LongColumnVector) {
        ((LongColumnVector) cv).vector = null;
    } else if (cv instanceof DoubleColumnVector) {
        ((DoubleColumnVector) cv).vector = null;
    } else if (cv instanceof BytesColumnVector) {
        ((BytesColumnVector) cv).vector = null;
        ((BytesColumnVector) cv).start = null;
        ((BytesColumnVector) cv).length = null;
    } else if (cv instanceof DecimalColumnVector) {
        ((DecimalColumnVector) cv).vector = null;
    }
}
Also used : DecimalColumnVector(org.apache.orc.storage.ql.exec.vector.DecimalColumnVector) DoubleColumnVector(org.apache.orc.storage.ql.exec.vector.DoubleColumnVector) ListColumnVector(org.apache.orc.storage.ql.exec.vector.ListColumnVector) MapColumnVector(org.apache.orc.storage.ql.exec.vector.MapColumnVector) StructColumnVector(org.apache.orc.storage.ql.exec.vector.StructColumnVector) UnionColumnVector(org.apache.orc.storage.ql.exec.vector.UnionColumnVector) BytesColumnVector(org.apache.orc.storage.ql.exec.vector.BytesColumnVector) LongColumnVector(org.apache.orc.storage.ql.exec.vector.LongColumnVector) ListColumnVector(org.apache.orc.storage.ql.exec.vector.ListColumnVector) UnionColumnVector(org.apache.orc.storage.ql.exec.vector.UnionColumnVector) BytesColumnVector(org.apache.orc.storage.ql.exec.vector.BytesColumnVector) StructColumnVector(org.apache.orc.storage.ql.exec.vector.StructColumnVector) DecimalColumnVector(org.apache.orc.storage.ql.exec.vector.DecimalColumnVector) LongColumnVector(org.apache.orc.storage.ql.exec.vector.LongColumnVector) ColumnVector(org.apache.orc.storage.ql.exec.vector.ColumnVector) MapColumnVector(org.apache.orc.storage.ql.exec.vector.MapColumnVector) DoubleColumnVector(org.apache.orc.storage.ql.exec.vector.DoubleColumnVector)

Example 2 with ColumnVector

use of org.apache.orc.storage.ql.exec.vector.ColumnVector in project incubator-gobblin by apache.

the class GenericRecordToOrcValueWriter method write.

@Override
public void write(GenericRecord value, VectorizedRowBatch output) throws IOException {
    int row = output.size++;
    for (int c = 0; c < converters.length; ++c) {
        ColumnVector col = output.cols[c];
        if (value.get(c) == null) {
            col.noNulls = false;
            col.isNull[row] = true;
        } else {
            col.isNull[row] = false;
            converters[c].addValue(row, c, value.get(c), col);
        }
    }
}
Also used : UnionColumnVector(org.apache.orc.storage.ql.exec.vector.UnionColumnVector) DecimalColumnVector(org.apache.orc.storage.ql.exec.vector.DecimalColumnVector) LongColumnVector(org.apache.orc.storage.ql.exec.vector.LongColumnVector) MapColumnVector(org.apache.orc.storage.ql.exec.vector.MapColumnVector) ListColumnVector(org.apache.orc.storage.ql.exec.vector.ListColumnVector) BytesColumnVector(org.apache.orc.storage.ql.exec.vector.BytesColumnVector) StructColumnVector(org.apache.orc.storage.ql.exec.vector.StructColumnVector) ColumnVector(org.apache.orc.storage.ql.exec.vector.ColumnVector) DoubleColumnVector(org.apache.orc.storage.ql.exec.vector.DoubleColumnVector)

Aggregations

BytesColumnVector (org.apache.orc.storage.ql.exec.vector.BytesColumnVector)2 ColumnVector (org.apache.orc.storage.ql.exec.vector.ColumnVector)2 DecimalColumnVector (org.apache.orc.storage.ql.exec.vector.DecimalColumnVector)2 DoubleColumnVector (org.apache.orc.storage.ql.exec.vector.DoubleColumnVector)2 ListColumnVector (org.apache.orc.storage.ql.exec.vector.ListColumnVector)2 LongColumnVector (org.apache.orc.storage.ql.exec.vector.LongColumnVector)2 MapColumnVector (org.apache.orc.storage.ql.exec.vector.MapColumnVector)2 StructColumnVector (org.apache.orc.storage.ql.exec.vector.StructColumnVector)2 UnionColumnVector (org.apache.orc.storage.ql.exec.vector.UnionColumnVector)2