ATHENA UDF LAMBDA ISSUE

0

HI , when im using athena udf , im not able to read functions arguments in lambda function, getting key error while extracting from event . Here is my athena function sql :

USING EXTERNAL FUNCTION jaro_winkler_similarity(str1 VARCHAR, str2 VARCHAR) RETURNS VARCHAR LAMBDA 'de-athena-jaro_winkler' SELECT jaro_winkler_similarity('bank_verified_name', 'P_bank_verified_name1') as fuzzy_name1

Im using python and here is the print(event )

{'@type': 'PingRequest', 'identity': {'id': 'UNKNOWN', 'principal': 'UNKNOWN', 'account': 'x, 'arn': 'arn:aws:sts::x:assumed-role/GL-DW-Custom-DEV/x@x.com', 'tags': {'IAM': 'CustomRole'}, 'groups': []}, 'catalogName': 'jaro_winkler_similarity', 'queryId': '4671af00-f8f5-49c5-9c9f-db401b7ba4e7'}

lambda code :

import jellyfish def lambda_handler(event, context): print(event) print(context) str1 = event['str1'] str2 = event['str2'] similarity = jellyfish.jaro_winkler_similarity(str1, str2) * 100 return similarity

Guna
asked 7 months ago283 views
1 Answer
0

Currently, Athena UDFs support the Java 8 and Java 11 run-times for Lambda. You cannot use a Python run-time for a UDF.

Refer to the documentation here: Querying with user defined functions specifically the section "Considerations and limitations".

AWS
EXPERT
answered 7 months ago
profile pictureAWS
EXPERT
reviewed 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