Athena UDF lambda, An error occurred during JSON parsing

0

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

asked 7 months ago259 views
1 Answer
0

Hello,

I understand that you are seeing error when trying to run the UDF using Lambda function.

Could you please have a look at the Cloudwatch logs of the lambda function? We might be able to gather some more information from it. Instead of this vague message [An error occurred during JSON parsing], we should be able to see few more details about why it had failed.

profile pictureAWS
SUPPORT ENGINEER
Chaitu
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions