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
gefragt vor 8 Monaten301 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 8 Monaten
profile pictureAWS
EXPERTE
überprüft vor 8 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen