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

질문됨 8달 전280회 조회
1개 답변
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
지원 엔지니어
Chaitu
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠