Package org.apache.hadoop.hive.ql.exec.vector

Examples of org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch


  }

  @Test
  public void testSelectColumnIsNull() {
    // has nulls, not repeating
    VectorizedRowBatch batch = getBatchThreeBooleanCols();
    SelectColumnIsNull expr = new SelectColumnIsNull(0);
    expr.evaluate(batch);
    assertEquals(3, batch.size);
    assertEquals(4, batch.selected[0]);
    assertEquals(5, batch.selected[1]);
View Full Code Here


  }

  @Test
  public void testSelectColumnIsNotNull() {
    // has nulls, not repeating
    VectorizedRowBatch batch = getBatchThreeBooleanCols();
    SelectColumnIsNotNull expr = new SelectColumnIsNotNull(0);
    expr.evaluate(batch);
    assertEquals(6, batch.size);
    assertEquals(0, batch.selected[0]);
    assertEquals(1, batch.selected[1]);
View Full Code Here

    Assert.assertEquals(initialSize, batch.size);
  }

  @Test
  public void testFilterExprOrExpr() {
    VectorizedRowBatch batch1 = getBatchThreeBooleanCols();
    VectorizedRowBatch batch2 = getBatchThreeBooleanCols();

    SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
    SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);

    FilterExprOrExpr orExpr = new FilterExprOrExpr();
View Full Code Here

    assertEquals(7, batch1.selected[4]);
  }

  @Test
  public void testFilterExprOrExprWithBatchReuse() {
    VectorizedRowBatch batch1 = getBatchThreeBooleanCols();

    SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
    SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);

    FilterExprOrExpr orExpr = new FilterExprOrExpr();
View Full Code Here

    assertEquals(6, batch1.selected[4]);
  }

  @Test
  public void testFilterExprOrExprWithSelectInUse() {
    VectorizedRowBatch batch1 = getBatchThreeBooleanCols();

    SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
    SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);

    FilterExprOrExpr orExpr = new FilterExprOrExpr();
View Full Code Here

    assertEquals(7, batch1.selected[2]);
  }

  @Test
  public void testFilterExprAndExpr() {
    VectorizedRowBatch batch1 = getBatchThreeBooleanCols();

    SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
    SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);

    FilterExprAndExpr andExpr = new FilterExprAndExpr();
View Full Code Here

  @Test
  public void testLongInExpr() {

    // check basic operation
    VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchLongInLongOut();
    LongColumnVector outV = (LongColumnVector) b.cols[1];
    long[] inVals = new long[2];
    inVals[0] = 0;
    inVals[1] = -2;
    LongColumnInList expr = new LongColumnInList(0, 1);
View Full Code Here

  @Test
  public void testDoubleInExpr() {

    // check basic operation
    VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDoubleInLongOut();
    LongColumnVector outV = (LongColumnVector) b.cols[1];
    double[] inVals = new double[2];
    inVals[0] = -1.5d;
    inVals[1] = 30d;
    b.size = 2;
View Full Code Here

    return Math.abs(a - b) < eps;
  }

  @Test
  public void testVectorRound() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    VectorExpression expr = new FuncRoundDoubleToDouble(0, 1);
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
    b.cols[0].noNulls = true;
    expr.evaluate(b);
    Assert.assertEquals(-2d, resultV.vector[0]);
View Full Code Here

    Assert.assertEquals(true, resultV.isRepeating);
  }

  @Test
  public void testRoundToDecimalPlaces() {
    VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
    VectorExpression expr = new RoundWithNumDigitsDoubleToDouble(0, 4, 1);
    ((ISetLongArg) expr).setArg(4)// set number of digits
    expr.evaluate(b);
    DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch

Copyright © 2018 www.massapicom. 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.