use of org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector in project flink by apache.
the class AbstractOrcColumnVector method createDoubleVector.
private static DoubleColumnVector createDoubleVector(int batchSize, Object value) {
DoubleColumnVector dcv = new DoubleColumnVector(batchSize);
if (value == null) {
dcv.noNulls = false;
dcv.isNull[0] = true;
dcv.isRepeating = true;
} else {
dcv.fill(((Number) value).doubleValue());
dcv.isNull[0] = false;
}
return dcv;
}
use of org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector in project hive by apache.
the class AbstractExpression method getDoubleColumnVectorWithNull.
protected DoubleColumnVector getDoubleColumnVectorWithNull() {
DoubleColumnVector columnVector = new DoubleColumnVector(VectorizedRowBatch.DEFAULT_SIZE);
columnVector.noNulls = false;
Random random = new Random();
for (int i = 0; i != VectorizedRowBatch.DEFAULT_SIZE; i++) {
if (i % 100 == 0) {
columnVector.isNull[i] = true;
}
columnVector.vector[i] = random.nextDouble();
}
return columnVector;
}
use of org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector in project hive by apache.
the class AbstractExpression method getRepeatingDoubleColumnVector.
protected DoubleColumnVector getRepeatingDoubleColumnVector() {
DoubleColumnVector columnVector = new DoubleColumnVector(VectorizedRowBatch.DEFAULT_SIZE);
columnVector.fill(2.0d);
return columnVector;
}
use of org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector in project hive by apache.
the class AbstractExpression method getDoubleColumnVector.
protected DoubleColumnVector getDoubleColumnVector() {
DoubleColumnVector columnVector = new DoubleColumnVector(VectorizedRowBatch.DEFAULT_SIZE);
Random random = new Random();
for (int i = 0; i != VectorizedRowBatch.DEFAULT_SIZE; i++) {
columnVector.vector[i] = random.nextDouble();
}
return columnVector;
}
use of org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector in project hive by apache.
the class TestVectorTypeCasts method getBatchDecimalDouble.
private VectorizedRowBatch getBatchDecimalDouble() {
VectorizedRowBatch b = new VectorizedRowBatch(2);
DecimalColumnVector dv;
short scale = 2;
b.cols[0] = dv = new DecimalColumnVector(18, scale);
b.cols[1] = new DoubleColumnVector();
b.size = 3;
dv.vector[0].set(HiveDecimal.create("1.1"));
dv.vector[1].set(HiveDecimal.create("-2.2"));
dv.vector[2].set(HiveDecimal.create("9999999999999999.00"));
return b;
}
Aggregations