use of org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.byteTypeInfo in project hive by apache.
the class TestGenericUDFNullif method testByteNeq.
@Test
public void testByteNeq() throws HiveException {
GenericUDFNullif udf = new GenericUDFNullif();
ObjectInspector[] inputOIs = { PrimitiveObjectInspectorFactory.writableByteObjectInspector, PrimitiveObjectInspectorFactory.writableByteObjectInspector };
DeferredObject[] args = { new DeferredJavaObject(new ByteWritable((byte) 4)), new DeferredJavaObject(new ByteWritable((byte) 1)) };
PrimitiveObjectInspector oi = (PrimitiveObjectInspector) udf.initialize(inputOIs);
Assert.assertEquals(TypeInfoFactory.byteTypeInfo, oi.getTypeInfo());
ByteWritable res = (ByteWritable) udf.evaluate(args);
Assert.assertEquals(4, res.get());
}
Aggregations