use of org.apache.hadoop.hive.serde2.io.DoubleWritable in project hive by apache.
the class TestUDFMath method testRadians.
@Test
public void testRadians() throws HiveException {
UDFRadians udf = new UDFRadians();
input = createDecimal("45.0");
DoubleWritable res = udf.evaluate(input);
Assert.assertEquals(0.7853981633974483, res.get(), 0.000001);
}
use of org.apache.hadoop.hive.serde2.io.DoubleWritable in project hive by apache.
the class TestUDFMath method testAsin.
@Test
public void testAsin() throws HiveException {
UDFAsin udf = new UDFAsin();
input = createDecimal("0.716");
DoubleWritable res = udf.evaluate(input);
Assert.assertEquals(0.7980555152315012, res.get(), 0.000001);
}
use of org.apache.hadoop.hive.serde2.io.DoubleWritable in project hive by apache.
the class TestUDFMath method testLog2.
@Test
public void testLog2() throws HiveException {
UDFLog2 udf = new UDFLog2();
input = createDecimal("8.0");
DoubleWritable res = udf.evaluate(input);
Assert.assertEquals(3.0, res.get(), 0.000001);
}
use of org.apache.hadoop.hive.serde2.io.DoubleWritable in project hive by apache.
the class TestUDFMath method testCos.
@Test
public void testCos() throws HiveException {
UDFCos udf = new UDFCos();
input = createDecimal("0.7727408115633954");
DoubleWritable res = udf.evaluate(input);
Assert.assertEquals(0.716, res.get(), 0.000001);
}
use of org.apache.hadoop.hive.serde2.io.DoubleWritable in project hive by apache.
the class TestUDFMath method testDegrees.
@Test
public void testDegrees() throws HiveException {
UDFDegrees udf = new UDFDegrees();
input = createDecimal("0.7853981633974483");
DoubleWritable res = udf.evaluate(input);
Assert.assertEquals(45.0, res.get(), 0.000001);
}
Aggregations