How to send SNS notification from a Glue Streaming job and include the contents of a dataframe in the message body?

0

0 Hello, I am running a glue streaming job where I read data from KDS, do some aggregation and filter it. I want to trigger SNS on this filtered DF and include its column values in the SNS message body. If I write data directly to S3 from the filtered DF without adding any code for calling SNS, it works fine. If I add the logic for calling SNS on the filtered DF, SNS gets triggered but somehow the filtered df is sent empty and nothing gets written to S3. What is the best way to do it? Many thanks.

1回答
0

Inside the forEach function, get the DataFrame contents with collect() and then use it to call the SNS client using boto3.
Make sure the DataFrame contents are small so it cannot break, for instance using take() instead of collect if you know that makes the volume of data retrieved predictable.

profile pictureAWS
エキスパート
回答済み 5ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ