1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
0
【以下的回答经过翻译处理】 在 PySpark 中,您可以使用 forEachPartition 并为该分区调用 Kinesis 或任何外部 API,或者您也可以使用 map 并按记录调用 Kinesis。
# 方法 1:每个分区
def pushToKinesis(迭代器):
打印(列表(迭代器)[0]
#push to kinesis 使用 boto3 APIs
rdd.foreachPartition(pushToKinesis())
# 方法二:每条记录
def pushToKinesis(记录):
#push to kinesis 使用 boto3 APIs
rdd.map(lambda l: pushToKinesis(l))
下面的博文使用方法 2 调用 Amazon Comprehend: https://aws.amazon.com/blogs/machine-learning/how-to-scale-sentiment-analysis-using-amazon-comprehend-aws-glue-and-amazon-athena/
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren