use of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableBinaryObjectInspector in project hive by apache.
the class TestGenericUDFAesDecrypt method testAesDec256ConstStr.
@Test
public void testAesDec256ConstStr() throws HiveException, NoSuchAlgorithmException {
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
// Jurisdiction Policy Files not installed
if (maxKeyLen < 256) {
return;
}
GenericUDFAesDecrypt udf = new GenericUDFAesDecrypt();
ObjectInspector valueOI0 = PrimitiveObjectInspectorFactory.writableBinaryObjectInspector;
Text keyWr = new Text("1234567890123456" + "1234567890123456");
ObjectInspector valueOI1 = PrimitiveObjectInspectorFactory.getPrimitiveWritableConstantObjectInspector(TypeInfoFactory.stringTypeInfo, keyWr);
ObjectInspector[] arguments = { valueOI0, valueOI1 };
udf.initialize(arguments);
runAndVerifyStr("nYfCuJeRd5eD60yXDw7WEA==", keyWr, "ABC", udf);
runAndVerifyStr("mVClVqZ6W4VF6b842FOgCA==", keyWr, "", udf);
// null
runAndVerifyStr(null, keyWr, null, udf);
}
use of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableBinaryObjectInspector in project hive by apache.
the class TestGenericUDFAesDecrypt method testAesDecKeyNullStr.
@Test
public void testAesDecKeyNullStr() throws HiveException {
GenericUDFAesDecrypt udf = new GenericUDFAesDecrypt();
ObjectInspector valueOI0 = PrimitiveObjectInspectorFactory.writableBinaryObjectInspector;
ObjectInspector valueOI1 = PrimitiveObjectInspectorFactory.writableStringObjectInspector;
ObjectInspector[] arguments = { valueOI0, valueOI1 };
udf.initialize(arguments);
Text keyWr = null;
runAndVerifyStr("y6Ss+zCYObpCbgfWfyNWTw==", keyWr, null, udf);
}
use of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableBinaryObjectInspector 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