1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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:
répondu il y a 6 ans
Contenus pertinents
- demandé il y a 6 mois
- demandé il y a un an
- demandé il y a 6 mois
- AWS OFFICIELA mis à jour il y a 4 ans
- AWS OFFICIELA mis à jour il y a 5 mois
- AWS OFFICIELA mis à jour il y a 6 mois
- AWS OFFICIELA mis à jour il y a 5 mois