use of org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.binaryTypeInfo in project hive by apache.
the class TestGenericUDFAesDecrypt method testAesDec128ConstBin.
@Test
public void testAesDec128ConstBin() throws HiveException {
GenericUDFAesDecrypt udf = new GenericUDFAesDecrypt();
ObjectInspector valueOI0 = PrimitiveObjectInspectorFactory.writableBinaryObjectInspector;
BytesWritable keyWr = new BytesWritable("1234567890123456".getBytes());
ObjectInspector valueOI1 = PrimitiveObjectInspectorFactory.getPrimitiveWritableConstantObjectInspector(TypeInfoFactory.binaryTypeInfo, keyWr);
ObjectInspector[] arguments = { valueOI0, valueOI1 };
udf.initialize(arguments);
runAndVerifyBin("y6Ss+zCYObpCbgfWfyNWTw==", keyWr, "ABC", udf);
runAndVerifyBin("BQGHoM3lqYcsurCRq3PlUw==", keyWr, "", udf);
// null
runAndVerifyBin(null, keyWr, null, udf);
}
use of org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.binaryTypeInfo in project hive by apache.
the class TestGenericUDFAesEncrypt method testAesEncKeyNullConstBin.
@Test
public void testAesEncKeyNullConstBin() throws HiveException {
GenericUDFAesEncrypt udf = new GenericUDFAesEncrypt();
ObjectInspector valueOI0 = PrimitiveObjectInspectorFactory.writableBinaryObjectInspector;
BytesWritable keyWr = null;
ObjectInspector valueOI1 = PrimitiveObjectInspectorFactory.getPrimitiveWritableConstantObjectInspector(TypeInfoFactory.binaryTypeInfo, keyWr);
ObjectInspector[] arguments = { valueOI0, valueOI1 };
udf.initialize(arguments);
runAndVerifyBin(new byte[] { 65, 66, 67 }, keyWr, null, udf);
}
Aggregations