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

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


   */
  private final double EPS = 1e-7d;

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


  }

  private VectorizedRowBatch getBatchSingleLongVectorPositiveNonZero() {
    VectorizedRowBatch batch = new VectorizedRowBatch(2);
    final int size = VectorizedRowBatch.DEFAULT_SIZE;
    LongColumnVector lcv = new LongColumnVector();
    for (int i = 0; i < size; i++) {
      lcv.vector[i] = (i + 1) * 37;
    }
    batch.cols[0] = lcv;
    batch.cols[1] = new LongColumnVector();
    batch.size = size;
    return batch;
  }
View Full Code Here

  @Test
  public void testLongScalarSubtractLongColWithNulls()  {
    VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector(
        VectorizedRowBatch.DEFAULT_SIZE);
    LongColumnVector lcv = (LongColumnVector) batch.cols[0];
    TestVectorizedRowBatch.addRandomNulls(lcv);
    LongScalarSubtractLongColumn expr = new LongScalarSubtractLongColumn(100, 0, 1);
    expr.evaluate(batch);

    //verify
View Full Code Here

        (LongColumnVector) batch.cols[1], batch.selected, batch.selectedInUse, batch.size);
  }

  @Test
  public void testLongScalarSubtractLongColWithRepeating() {
    LongColumnVector in, out;
    VectorizedRowBatch batch;
    LongScalarSubtractLongColumn expr;

    // Case 1: is repeating, no nulls
    batch = getVectorizedRowBatchSingleLongVector(
View Full Code Here

    a[1] = 1000;
    batch.size = 2;
    VectorExpression expr = (new LongColumnInList(0, 1));
    ((LongColumnInList) expr).setInListValues(a);
    expr.evaluate(batch);
    LongColumnVector out = (LongColumnVector) batch.cols[1];
    Assert.assertEquals(0, out.vector[0]);
    Assert.assertEquals(1, out.vector[1]);
  }
View Full Code Here

    Assert.assertEquals(1, out.vector[1]);
  }

  private VectorizedRowBatch getBatch() {
    VectorizedRowBatch b = new VectorizedRowBatch(2);
    LongColumnVector v = new LongColumnVector();
    v.vector[0] = 10;
    v.vector[1] = 20;
    b.cols[0] = v;
    b.cols[1] = new LongColumnVector();
    return b;
  }
View Full Code Here

    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;
    vrg.cols[1] = new LongColumnVector(size);
    vrg.size = size;
    return vrg;
  }
View Full Code Here

    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;
    }
    batch.cols[0] = lcv;
    lcv2 = new LongColumnVector();
    batch.cols[1] = lcv2;
    for (int i = 0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) {
      lcv2.vector[i] = i * 37;
    }
    batch.cols[2] = new DoubleColumnVector();
View Full Code Here

  @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);
    expr.evaluate(batch);

    // verify
View Full Code Here

    verifyLongNullDataVectorEntries(lcvOut, batch.selected, batch.selectedInUse, batch.size);
  }

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

    // Case 1: is repeating, no nulls
    batch = getVectorizedRowBatchSingleLongVector(VectorizedRowBatch.DEFAULT_SIZE);
View Full Code Here

TOP

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

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.