use of org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DoubleColUnaryMinus in project hive by apache.
the class TestVectorizationContext method testUnaryMinusColumnDouble.
@Test
public void testUnaryMinusColumnDouble() throws HiveException {
ExprNodeColumnDesc col1Expr = new ExprNodeColumnDesc(Float.class, "col1", "table", false);
GenericUDF gudf = new GenericUDFOPNegative();
List<ExprNodeDesc> children = new ArrayList<ExprNodeDesc>(1);
children.add(col1Expr);
ExprNodeGenericFuncDesc negExprDesc = new ExprNodeGenericFuncDesc(TypeInfoFactory.doubleTypeInfo, gudf, children);
List<String> columns = new ArrayList<String>();
columns.add("col0");
columns.add("col1");
VectorizationContext vc = new VectorizationContext("name", columns);
VectorExpression ve = vc.getVectorExpression(negExprDesc, VectorExpressionDescriptor.Mode.PROJECTION);
assertTrue(ve instanceof DoubleColUnaryMinus);
}
Aggregations