Examples of IfExprStringScalarStringGroupColumn


Examples of org.apache.hadoop.hive.ql.exec.vector.expressions.IfExprStringScalarStringGroupColumn

  @Test
  public void testIfExprStringScalarStringColumn() {
    VectorizedRowBatch batch = getBatch1Long3BytesVectors();
    byte[] scalar = getUTF8Bytes("scalar");
    VectorExpression expr = new IfExprStringScalarStringGroupColumn(0,scalar, 2, 3);
    BytesColumnVector r = (BytesColumnVector) batch.cols[3];
    expr.evaluate(batch);
    assertTrue(getString(r, 0).equals("arg3_0"));
    assertTrue(getString(r, 1).equals("arg3_1"));
    assertTrue(getString(r, 2).equals("scalar"));
    assertTrue(getString(r, 3).equals("scalar"));
    assertTrue(r.noNulls);

    // test for null input strings
    batch = getBatch1Long3BytesVectors();
    BytesColumnVector arg3 = (BytesColumnVector) batch.cols[2];
    arg3.noNulls = false;
    arg3.isNull[1] = true;
    arg3.vector[1] = null;
    expr.evaluate(batch);
    r = (BytesColumnVector) batch.cols[3];
    assertTrue(!r.noNulls && r.isNull[1]);
  }
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.