How to load data to a Tuple using Spark

I created a tuple and used it as an attribute to one of my edges. I would like to understand how we can load data into the edge using Spark.

I created a GSQL loading job and called the same from my Spark program and it works well. Also, when we load using GraphStudio, we get an option “UDT Widget” using which we can map columns into the tuple from the input file. Likewise, I am trying to understand how to do this programmatically? Can anyone help me on the same?

I kept the data that needs to be loaded into the tuple in JSON format inside a dataframe. But I am getting below error when I execute my spark job

Caused by: java.sql.SQLException: Processing attribute myTuple failed, keylist has different length with UDT fields

1 Like