Examples of VectorizedRowBatch


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

  }


  @Override
  public Writable serialize(Object obj, ObjectInspector inspector) {
    VectorizedRowBatch batch = (VectorizedRowBatch) obj;
    try {
      for (int i = 0; i < batch.size; i++) {
        OrcStruct ost = orcStructArray[i];
        if (ost == null) {
          ost = new OrcStruct(batch.numCols);
View Full Code Here

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

      // We should never get here.
      assertTrue(false);
    }

    VectorizedRowBatch b = getBatchLongInLongOut();
    vudf.evaluate(b);

    // verify output
    LongColumnVector out = (LongColumnVector) b.cols[1];
    assertEquals(1000, out.vector[0]);
View Full Code Here

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

      assertTrue(false);
      throw new RuntimeException(e);
    }

    // with no nulls
    VectorizedRowBatch b = getBatchStrDblLongWithStrOut();
    vudf.evaluate(b);
    byte[] result = null;
    byte[] result2 = null;
    try {
      result = "red:1:1.0".getBytes("UTF-8");
View Full Code Here

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

    assertEquals(0, cmp);
    assertTrue(out.noNulls);
  }

  private VectorizedRowBatch getBatchLongInLongOut() {
    VectorizedRowBatch b = new VectorizedRowBatch(2);
    LongColumnVector in = new LongColumnVector();
    LongColumnVector out = new LongColumnVector();
    b.cols[0] = in;
    b.cols[1] = out;
    in.vector[0] = 0;
View Full Code Here

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

    b.size = 3;
    return b;
  }

  private VectorizedRowBatch getBatchStrDblLongWithStrOut() {
    VectorizedRowBatch b = new VectorizedRowBatch(4);
    BytesColumnVector strCol = new BytesColumnVector();
    LongColumnVector longCol = new LongColumnVector();
    DoubleColumnVector dblCol = new DoubleColumnVector();
    BytesColumnVector outCol = new BytesColumnVector();
    b.cols[0] = strCol;
View Full Code Here

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

      // We should never get here.
      assertTrue(false);
    }

    VectorizedRowBatch b;

    byte[] red = null;
    byte[] unknown = null;
    try {
      red = "red".getBytes("UTF-8");
View Full Code Here

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

        OrcFile.readerOptions(conf));
    Reader reader = OrcFile.createReader(testFilePath,
        OrcFile.readerOptions(conf));
    RecordReaderImpl vrr = (RecordReaderImpl) vreader.rows();
    RecordReaderImpl rr = (RecordReaderImpl) reader.rows();
    VectorizedRowBatch batch = null;
    OrcStruct row = null;

    // Check Vectorized ORC reader against ORC row reader
    while (vrr.hasNext()) {
      batch = vrr.nextBatch(batch);
View Full Code Here

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

*/
public class TestUnaryMinus {

  @Test
  public void testUnaryMinus() {
    VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(1024, 2, 23);
    LongColUnaryMinus expr = new LongColUnaryMinus(0, 1);
    expr.evaluate(vrg);
    //verify
    long[] inVector = ((LongColumnVector) vrg.cols[0]).vector;
    long[] outVector = ((LongColumnVector) vrg.cols[1]).vector;
View Full Code Here

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

   * not always reliable so use this as a tolerance.
   */
  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;
View Full Code Here

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

    batch.size = size;
    return batch;
  }

  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;
    }
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.