use of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.StringGroupColEqualCharScalar in project hive by apache.
the class TestVectorStringExpressions method testStringColCompareCharScalarProjection.
@Test
public void testStringColCompareCharScalarProjection() {
VectorizedRowBatch batch = makeStringBatch();
VectorExpression expr;
expr = new StringGroupColEqualCharScalar(0, new HiveChar(new String(red2), 8), 2);
expr.evaluate(batch);
Assert.assertEquals(3, batch.size);
LongColumnVector outVector = (LongColumnVector) batch.cols[2];
Assert.assertEquals(1, outVector.vector[0]);
Assert.assertEquals(0, outVector.vector[1]);
Assert.assertEquals(0, outVector.vector[2]);
batch = makeStringBatch();
expr = new StringGroupColEqualCharScalar(0, new HiveChar(new String(green), 10), 2);
expr.evaluate(batch);
Assert.assertEquals(3, batch.size);
outVector = (LongColumnVector) batch.cols[2];
Assert.assertEquals(0, outVector.vector[0]);
Assert.assertEquals(1, outVector.vector[1]);
Assert.assertEquals(0, outVector.vector[2]);
}
Aggregations