s3://pinecone-jars/0.2.1/spark-pinecone-uberjar.jar
withColumn
adds a column to the dataframe, containing a simple increasing identifier that you cast to a string.
mapPartitions
function, which provides finer control over the execution of the UDF by explicitly applying it to each partition of the RDD.
3. Convert the resulting RDD back into a dataframe with the schema required by Pinecone: