Examples of evaluate()


Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncASinDoubleToDouble.evaluate()

  public void testVectorASin() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncASinDoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(Math.asin(0.5d), resultV.vector[4]);
  }

  @Test
  public void testVectorACos() {

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncATanDoubleToDouble.evaluate()

  public void testVectorATan() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncATanDoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(Math.atan(0.5d), resultV.vector[4]);
  }

  @Test
  public void testVectorDegrees() {

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncAbsDoubleToDouble.evaluate()

    // test double->double version
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncAbsDoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(1.5, resultV.vector[0]);
    Assert.assertEquals(0.5, resultV.vector[4]);

    // test long->long version
    b = getVectorizedRowBatchLongInLongOut();

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncCeilDoubleToLong.evaluate()

  public void testVectorCeil() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInLongOut();
    LongColumnVector resultV = (LongColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncCeilDoubleToLong(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(-1, resultV.vector[0]);
    Assert.assertEquals(2, resultV.vector[6]);
  }

  @Test

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncCosDoubleToDouble.evaluate()

  public void testVectorCos() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncCosDoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(Math.cos(0.5d), resultV.vector[4]);
  }

  @Test
  public void testVectorTan() {

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncDegreesDoubleToDouble.evaluate()

  public void testVectorDegrees() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncDegreesDoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(Math.toDegrees(0.5d), resultV.vector[4]);
  }

  @Test
  public void testVectorRadians() {

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncExpDoubleToDouble.evaluate()

  public void testVectorExp() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncExpDoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(Math.exp(0.5d), resultV.vector[4]);
  }

  @Test
  public void testVectorLn() {

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncFloorDoubleToLong.evaluate()

  public void testVectorFloor() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInLongOut();
    LongColumnVector resultV = (LongColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncFloorDoubleToLong(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(-2, resultV.vector[0]);
    Assert.assertEquals(1, resultV.vector[6]);
  }

  @Test

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLnDoubleToDouble.evaluate()

    // test double->double version
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncLnDoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertEquals(Math.log(0.5), resultV.vector[4]);

    // test long->double version
    b = getVectorizedRowBatchLongInDoubleOut();
    resultV = (DoubleColumnVector) b.cols[1];

Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FuncLog10DoubleToDouble.evaluate()

    // test double->double version
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    VectorExpression expr = new FuncLog10DoubleToDouble(0, 1);
    expr.evaluate(b);
    Assert.assertTrue(equalsWithinTolerance(Math.log(0.5d) / Math.log(10), resultV.vector[4]));

    // test long->double version
    b = getVectorizedRowBatchLongInDoubleOut();
    resultV = (DoubleColumnVector) b.cols[1];
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.