I have written a spark UDF in JAVA to encrypt particular columns in a dataframe. It is type 1 UDF and only accepts a string that needs to be encrypted or decrypted at a time. I want to pass corresponding password as well. I tried the currying approach but was not able to write the function properly. Can anyone suggest me any solution ?
public class EncryptString implements UDF1<String, String> {
@Override
public String call(String s) throws Exception {
return Aes256.encrypt(s);
//Aes.encrypt needs to have another variable password.
//So that while calling the UDF we can pass the required password.
}
}