Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 01:39 PM
It can be achieved using mapPartitions
val df_response = df.mapPartitions(iterator => {
val api_connect = new s3clientBuild()
val s3client = api_connect.s3connection(AccessKey, SecretKey)
val res = iterator.map(row =>{
val name = getS3(row.getString(0), s3client)
(name)
})
res
}).toDF("value")