I create lambda function to be used in athena UDF.
USING EXTERNAL FUNCTION decrypt(variable1 VARBINARY)
RETURNS VARCHAR
LAMBDA 'LambdaFunctionName'
SELECT decrypt(amount) FROM "database"."table_name" limit 10;
but it give error
GENERIC_USER_ERROR: io.trino.spi.TrinoException: Encountered an exception[java.lang.RuntimeException] from your LambdaFunction[LambdaFunctionName] executed in context[ping] with message[An error occurred during JSON parsing]
my lambda function using java code, the class extend UserDefinedFunctionHandler
and the code something like this
public String decrypt(String input) {
byte[] valueByte = input.getBytes();
String result = decryptByte(valueByte);
return result;
}
even when i change VARBINARY to VARCHAR, and change the query parameter to some string like SELECT decrypt('somestring')
it still give the same JSON parsing error