Search in sources :

Example 1 with HiveDecimal

use of org.apache.orc.storage.common.type.HiveDecimal in project flink by apache.

the class AbstractOrcNoHiveVector method createDecimalVector.

private static DecimalColumnVector createDecimalVector(int batchSize, int precision, int scale, Object value) {
    DecimalColumnVector dv = new DecimalColumnVector(batchSize, precision, scale);
    if (value == null) {
        dv.noNulls = false;
        dv.isNull[0] = true;
        dv.isRepeating = true;
    } else {
        dv.set(0, value instanceof HiveDecimal ? (HiveDecimal) value : HiveDecimal.create((BigDecimal) value));
        dv.isRepeating = true;
        dv.isNull[0] = false;
    }
    return dv;
}
Also used : DecimalColumnVector(org.apache.orc.storage.ql.exec.vector.DecimalColumnVector) HiveDecimal(org.apache.orc.storage.common.type.HiveDecimal)

Aggregations

HiveDecimal (org.apache.orc.storage.common.type.HiveDecimal)1 DecimalColumnVector (org.apache.orc.storage.ql.exec.vector.DecimalColumnVector)1