use of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncSinDoubleToDouble in project hive by apache.
the class TestVectorMathFunctions method testVectorSin.
/*
* The following tests spot-check that vectorized functions with signature
* DOUBLE func(DOUBLE) that came from template ColumnUnaryFunc.txt
* get the right result. Null propagation, isRepeating
* propagation will be checked once for a single expansion of the template
* (for FuncRoundDoubleToDouble).
*/
@Test
public void testVectorSin() {
VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
b.cols[0].noNulls = true;
VectorExpression expr = new FuncSinDoubleToDouble(0, 1);
expr.evaluate(b);
Assert.assertEquals(Math.sin(0.5d), resultV.vector[4]);
}
Aggregations