use of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncSqrtDoubleToDouble in project hive by apache.
the class TestVectorMathFunctions method testVectorSqrt.
@Test
public void testVectorSqrt() throws HiveException {
VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
b.cols[0].noNulls = true;
VectorExpression expr = new FuncSqrtDoubleToDouble(0, 1);
expr.evaluate(b);
Assert.assertEquals(Math.sqrt(0.5d), resultV.vector[4], Double.MIN_VALUE);
}
Aggregations