Examples of BytesColumnVector


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

    } catch (UnsupportedEncodingException e) {
    }
    udf.setInputTypes(VectorExpression.Type.STRING, VectorExpression.Type.TIMESTAMP);
    VectorizedRowBatch batch = new VectorizedRowBatch(2, 1);
    batch.cols[0] = new LongColumnVector(1);
    batch.cols[1] = new BytesColumnVector(1);
    udf.evaluate(batch);
    Assert.assertEquals(batch.cols[1].isNull[0], true);
  }
View Full Code Here

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

    } else {
      udf = new VectorUDFDateSubColCol(0, 1, 2);
    }
    udf.setInputTypes(colType1, VectorExpression.Type.OTHER);
    udf.evaluate(batch);
    BytesColumnVector output = (BytesColumnVector) batch.cols[2];
    try {
      for (int i = 0; i < date2.vector.length; i++) {
        String expected;
        if (isPositive) {
          expected = new String(toString(date1.vector[i] + date2.vector[i]), "UTF-8");
View Full Code Here

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

  private void testDateAddColCol(VectorExpression.Type colType1, boolean isPositive) {
    LongColumnVector date1 = newRandomLongColumnVector(10000, size);
    LongColumnVector days2 = newRandomLongColumnVector(1000, size);
    ColumnVector col1 = castTo(date1, colType1);

    BytesColumnVector output = new BytesColumnVector(size);

    VectorizedRowBatch batch = new VectorizedRowBatch(3, size);
    batch.cols[0] = col1;
    batch.cols[1] = days2;
    batch.cols[2] = output;
View Full Code Here

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

    for (VectorExpression.Type colType1 : dateTimestampStringTypes)
      testDateAddColCol(colType1, true);

    VectorExpression udf = new VectorUDFDateAddColCol(0, 1, 2);
    VectorizedRowBatch batch = new VectorizedRowBatch(3, 1);
    BytesColumnVector bcv;
    byte[] bytes = new byte[0];
    try {
      bytes = "error".getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
    }

    udf.setInputTypes(VectorExpression.Type.STRING, VectorExpression.Type.TIMESTAMP);
    batch.cols[0] = new BytesColumnVector(1);
    batch.cols[1] = new LongColumnVector(1);
    batch.cols[2] = new BytesColumnVector(1);
    bcv = (BytesColumnVector) batch.cols[0];
    bcv.vector[0] = bytes;
    bcv.start[0] = 0;
    bcv.length[0] = bytes.length;
    udf.evaluate(batch);
View Full Code Here

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

    for (VectorExpression.Type colType1 : dateTimestampStringTypes)
      testDateAddColCol(colType1, false);

    VectorExpression udf = new VectorUDFDateSubColCol(0, 1, 2);
    VectorizedRowBatch batch = new VectorizedRowBatch(3, 1);
    BytesColumnVector bcv;
    byte[] bytes = new byte[0];
    try {
      bytes = "error".getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
    }

    udf.setInputTypes(VectorExpression.Type.STRING, VectorExpression.Type.TIMESTAMP);
    batch.cols[0] = new BytesColumnVector(1);
    batch.cols[1] = new LongColumnVector(1);
    batch.cols[2] = new BytesColumnVector(1);
    bcv = (BytesColumnVector) batch.cols[0];
    bcv.vector[0] = bytes;
    bcv.start[0] = 0;
    bcv.length[0] = bytes.length;
    udf.evaluate(batch);
View Full Code Here

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

    }
    VectorizedRowBatch batch = new VectorizedRowBatch(2, 1);

    udf = new VectorUDFDateDiffScalarCol(0, 0, 1);
    udf.setInputTypes(VectorExpression.Type.TIMESTAMP, VectorExpression.Type.STRING);
    batch.cols[0] = new BytesColumnVector(1);
    batch.cols[1] = new LongColumnVector(1);

    BytesColumnVector bcv = (BytesColumnVector) batch.cols[0];
    bcv.vector[0] = bytes;
    bcv.start[0] = 0;
    bcv.length[0] = bytes.length;
    udf.evaluate(batch);
    Assert.assertEquals(batch.cols[1].isNull[0], true);
View Full Code Here

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

    }
    VectorizedRowBatch batch = new VectorizedRowBatch(2, 1);

    udf = new VectorUDFDateDiffColScalar(0, 0, 1);
    udf.setInputTypes(VectorExpression.Type.TIMESTAMP, VectorExpression.Type.STRING);
    batch.cols[0] = new BytesColumnVector(1);
    batch.cols[1] = new LongColumnVector(1);

    BytesColumnVector bcv = (BytesColumnVector) batch.cols[0];
    bcv.vector[0] = bytes;
    bcv.start[0] = 0;
    bcv.length[0] = bytes.length;
    udf.evaluate(batch);
    Assert.assertEquals(batch.cols[1].isNull[0], true);
View Full Code Here

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

      }
    }

    VectorExpression udf = new VectorUDFDateDiffColCol(0, 1, 2);
    VectorizedRowBatch batch = new VectorizedRowBatch(3, 1);
    BytesColumnVector bcv;
    byte[] bytes = new byte[0];
    try {
      bytes = "error".getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
    }

    udf.setInputTypes(VectorExpression.Type.STRING, VectorExpression.Type.TIMESTAMP);
    batch.cols[0] = new BytesColumnVector(1);
    batch.cols[1] = new LongColumnVector(1);
    batch.cols[2] = new LongColumnVector(1);
    bcv = (BytesColumnVector) batch.cols[0];
    bcv.vector[0] = bytes;
    bcv.start[0] = 0;
    bcv.length[0] = bytes.length;
    udf.evaluate(batch);
    Assert.assertEquals(batch.cols[2].isNull[0], true);

    udf.setInputTypes(VectorExpression.Type.TIMESTAMP, VectorExpression.Type.STRING);
    batch.cols[0] = new LongColumnVector(1);
    batch.cols[1] = new BytesColumnVector(1);
    batch.cols[2] = new LongColumnVector(1);
    bcv = (BytesColumnVector) batch.cols[1];
    bcv.vector[0] = bytes;
    bcv.start[0] = 0;
    bcv.length[0] = bytes.length;
View Full Code Here

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

      udf = new VectorUDFDateLong(0, 1);
    }

    udf.setInputTypes(colType);
    udf.evaluate(batch);
    BytesColumnVector output = (BytesColumnVector) batch.cols[1];

    for (int i = 0; i < size; i++) {
      String actual;
      if (output.isNull[i]) {
        actual = null;
View Full Code Here

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

  @Test
  public void testDate() {
    for (VectorExpression.Type colType : dateTimestampStringTypes) {
      LongColumnVector date = newRandomLongColumnVector(10000, size);
      BytesColumnVector output = new BytesColumnVector(size);

      VectorizedRowBatch batch = new VectorizedRowBatch(2, size);
      batch.cols[0] = castTo(date, colType);
      batch.cols[1] = output;

      validateDate(batch, colType, date);
      TestVectorizedRowBatch.addRandomNulls(date);
      batch.cols[0] = castTo(date, colType);
      validateDate(batch, colType, date);
    }

    VectorExpression udf = new VectorUDFDateString(0, 1);
    udf.setInputTypes(VectorExpression.Type.STRING);
    VectorizedRowBatch batch = new VectorizedRowBatch(2, 1);
    batch.cols[0] = new BytesColumnVector(1);
    batch.cols[1] = new BytesColumnVector(1);
    BytesColumnVector bcv = (BytesColumnVector) batch.cols[0];
    byte[] bytes = new byte[0];
    try {
      bytes = "error".getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
    }
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.