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

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


   * cases used in the source code template ColumnDivideScalarDecimal.txt.
   * The template is used for division and modulo.
   */
  @Test
  public void testDecimalColDivideDecimalScalar() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    Decimal128 d = new Decimal128("2.00", (short) 2);
    VectorExpression expr = new DecimalColDivideDecimalScalar(0, d, 2);


    // test without nulls
View Full Code Here


  /* Test decimal scalar divided column. This tests the primary logic
   * for template ScalarDivideColumnDecimal.txt.
   */
  @Test
  public void testDecimalScalarDivideDecimalColumn() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    Decimal128 d = new Decimal128("3.96", (short) 2)// 1.20 * 3.30
    VectorExpression expr = new DecimalScalarDivideDecimalColumn(d, 0, 2);

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

  }

  // Spot check Decimal Col-Scalar Modulo
  @Test
  public void testDecimalColModuloDecimalScalar() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    Decimal128 d = new Decimal128("2.00", (short) 2);
    VectorExpression expr = new DecimalColModuloDecimalScalar(0, d, 2);

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

  }

  // Spot check decimal scalar-column modulo
  @Test
  public void testDecimalScalarModuloDecimalColumn() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    Decimal128 d = new Decimal128("2.00", (short) 2);
    VectorExpression expr = new DecimalScalarModuloDecimalColumn(d, 0, 2);

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

    assertTrue(r.vector[2].equals(new Decimal128("0.60", (short) 2)));
  }

  @Test
  public void testDecimalColDivideDecimalColumn() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    DecimalColumnVector in1 = (DecimalColumnVector) b.cols[1];
    for (int i = 0; i < 3; i++) {
      in1.vector[i] = new Decimal128("0.50", (short) 2);
    }
    VectorExpression expr = new DecimalColDivideDecimalColumn(0, 1, 2);
View Full Code Here

  }

  // Spot check decimal column modulo decimal column
  @Test
  public void testDecimalColModuloDecimalColumn() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    DecimalColumnVector in1 = (DecimalColumnVector) b.cols[1];
    for (int i = 0; i < 3; i++) {
      in1.vector[i] = new Decimal128("0.50", (short) 2);
    }
    VectorExpression expr = new DecimalColModuloDecimalColumn(0, 1, 2);
View Full Code Here

  /* Spot check correctness of decimal column subtract decimal scalar. The case for
   * addition checks all the cases for the template, so don't do that redundantly here.
   */
  @Test
  public void testDecimalColSubtractDecimalScalar() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    Decimal128 d = new Decimal128(1);
    VectorExpression expr = new DecimalColSubtractDecimalScalar(0, d, 2);

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

  public FakeVectorRowBatchFromLongIterables(int batchSize, Iterable<Long>...iterables) {
    numCols = iterables.length;
    this.batchSize = batchSize;
    iterators = new ArrayList<Iterator<Long>>();
    batch = new VectorizedRowBatch(numCols, batchSize);
    for (int i =0; i < numCols; i++) {
      batch.cols[i] = new LongColumnVector(batchSize);
      iterators.add(iterables[i].iterator());
    }
  }
View Full Code Here

  /* Spot check correctness of decimal column multiply decimal scalar. The case for
   * addition checks all the cases for the template, so don't do that redundantly here.
   */
  @Test
  public void testDecimalColMultiplyDecimalScalar() {
    VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
    Decimal128 d = new Decimal128(2);
    VectorExpression expr = new DecimalColMultiplyDecimalScalar(0, d, 2);

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

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

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