cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write to Salesforce object using Spark Salesforce Library

theSoyf
New Contributor II

Screen Shot 2022-12-14 at 8.18.07 AMHi I'm facing an issue when writing to a salesforce object. I'm using the springml/spark-salesforce library. I have the above libraries installed as recommended based on my research.

I try to write like this:

(_sqldf

.write

.format("com.springml.spark.salesforce")

.option("username", sf_username)

.option("password", sf_password_token)

.option("sfObject", sf_object)

.option("upsert", True)

.save())

But I am receiving this error:

org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 15.0 failed 4 times, most recent failure: Lost task 0.3 in stage 15.0 (TID 15) (10.139.64.32 executor 0): java.lang.IllegalArgumentException: Can not instantiate Stax reader for XML source type class org.codehaus.stax2.io.Stax2ByteArraySource (unrecognized type)

2 REPLIES 2

Aviral-Bhardwaj
Esteemed Contributor III

this could not be the whole error can you please share the driver/error logs thread dump, I will try to help you

Gauthy
New Contributor II

Im facing the same issue while trying to write to Salesforce, if you have found a resolution could you please share it ?

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.