Examples of VectorizedRowBatch


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

    Assert.assertTrue(((LongColumnVector)vrg.cols[1]).noNulls);
    Assert.assertFalse(((LongColumnVector)vrg.cols[1]).isRepeating);
  }

  private VectorizedRowBatch getVectorizedRowBatchSingleLongVector(int size) {
    VectorizedRowBatch vrg = new VectorizedRowBatch(2, size);
    LongColumnVector lcv = new LongColumnVector(size);
    for (int i=0; i < size; i++) {
      lcv.vector[i] = i*37;
    }
    vrg.cols[0] = lcv;
View Full Code Here

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

    vrg.size = size;
    return vrg;
  }

  public static VectorizedRowBatch getVectorizedRowBatch2LongInDoubleOut() {
    VectorizedRowBatch batch = new VectorizedRowBatch(3);
    LongColumnVector lcv, lcv2;
    lcv = new LongColumnVector();
    for (int i = 0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) {
      lcv.vector[i] = i * 37;
    }
View Full Code Here

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

    return batch;
  }

  @Test
  public void testLongColAddLongScalarWithNulls()  {
    VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector(
        VectorizedRowBatch.DEFAULT_SIZE);
    LongColumnVector lcv = (LongColumnVector) batch.cols[0];
    LongColumnVector lcvOut = (LongColumnVector) batch.cols[1];
    TestVectorizedRowBatch.addRandomNulls(lcv);
    LongColAddLongScalar expr = new LongColAddLongScalar(0, 23, 1);
View Full Code Here

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

  }

  @Test
  public void testLongColAddLongScalarWithRepeating() {
    LongColumnVector in, out;
    VectorizedRowBatch batch;
    LongColAddLongScalar expr;

    // Case 1: is repeating, no nulls
    batch = getVectorizedRowBatchSingleLongVector(VectorizedRowBatch.DEFAULT_SIZE);
    in = (LongColumnVector) batch.cols[0];
View Full Code Here

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

  }

  @Test
  public void testLongColAddLongColumn() {
    int seed = 17;
    VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(
        VectorizedRowBatch.DEFAULT_SIZE,
        6, seed);
    LongColumnVector lcv0 = (LongColumnVector) vrg.cols[0];
    LongColumnVector lcv1 = (LongColumnVector) vrg.cols[1];
    LongColumnVector lcv2 = (LongColumnVector) vrg.cols[2];
View Full Code Here

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

  public void testLongColDivideLongColumn() {
    /* Testing for equality of doubles after a math operation is
     * not always reliable so use this as a tolerance.
     */
    final double eps = 1e-7d;
    VectorizedRowBatch batch = getVectorizedRowBatch2LongInDoubleOut();
    LongColDivideLongColumn expr = new LongColDivideLongColumn(0, 1, 2);
    batch.cols[0].isNull[1] = true;
    batch.cols[0].noNulls = false;
    batch.cols[1].noNulls = false;
    DoubleColumnVector out = (DoubleColumnVector) batch.cols[2];
View Full Code Here

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

    assertFalse(out.isRepeating);
  }

  @Test
  public void testDecimalColAddDecimalColumn() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    VectorExpression expr = new DecimalColAddDecimalColumn(0, 1, 2);
    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];

    // test without nulls
    expr.evaluate(b);
View Full Code Here

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

  }

  // Spot check decimal column-column subtract
  @Test
  public void testDecimalColSubtractDecimalColumn() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    VectorExpression expr = new DecimalColSubtractDecimalColumn(0, 1, 2);
    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];

    // test without nulls
    expr.evaluate(b);
View Full Code Here

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

  }

  // Spot check decimal column-column multiply
  @Test
  public void testDecimalColMultiplyDecimalColumn() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    VectorExpression expr = new DecimalColMultiplyDecimalColumn(0, 1, 2);
    DecimalColumnVector r = (DecimalColumnVector) b.cols[2];

    // test without nulls
    expr.evaluate(b);
View Full Code Here

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

  /* Test decimal column to decimal scalar addition. This is used to cover all the
   * cases used in the source code template ColumnArithmeticScalarDecimal.txt.
   */
  @Test
  public void testDecimalColAddDecimalScalar() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    Decimal128 d = new Decimal128(1);
    VectorExpression expr = new DecimalColAddDecimalScalar(0, d, 2);

    // test without nulls
    expr.evaluate(b);
View Full Code Here
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.