1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
In PySpark you can use forEachPartition and call Kinesis or any external API for that partition, or you can also use map and call out to Kinesis per record.
# Approach 1: Per Partition
def pushToKinesis(iterator):
print(list(iterator)[0]
#push to kinesis using boto3 APIs
rdd.foreachPartition(pushToKinesis())
# Approach 2: Per record
def pushToKinesis(record):
#push to kinesis using boto3 APIs
rdd.map(lambda l: pushToKinesis(l))
The blog post below uses Approach 2 to call Amazon Comprehend:
답변함 6년 전
관련 콘텐츠
- AWS 공식업데이트됨 4년 전
- AWS 공식업데이트됨 6달 전
- AWS 공식업데이트됨 일 년 전