# Spark-connector run error

**URL:** <https://www.singlestore.com/forum/t/spark-connector-run-error/1626>\
**Category:** Connectors and Pipelines\
**Created:** [February 11, 2020, 5:03am UTC](https://www.singlestore.com/forum/t/spark-connector-run-error/1626 "2020-02-11T05:03:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juoon](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/j/f07891/32.png) [@juoon](https://www.singlestore.com/forum/u/juoon)\
**Post date:** [February 11, 2020, 5:03am UTC](https://www.singlestore.com/forum/t/spark-connector-run-error/1626/1 "2020-02-11T05:03:21Z")

</div>

i use spark-connector like this in spark-streaming appliction:

```
kafkaDirectStream.foreachRDD(rdd => {
      try {
        if (!rdd.isEmpty) {
          val rowRdds = rdd.mapPartitions(partitions => {
            partitions.map(x => {
	    ......
	    })
	   })
	   val schema = StructType(Seq(StructField("Name", StringType, false),
                            StructField("Age", IntegerType, false)))

	  val df = sqlContext.createDataFrame(rdd, schema)
	  df
	    .write
	    .format("com.memsql.spark.connector")
	    .mode("error")
	    .save("people.students")
      } catch {
        case e: Exception => {
          throw new RuntimeException(e)
        }
      }
})

```

and result is there is only a little of data has been writed into memsql , and the speed is very slow. then i killed the application and find some error logs in then yarn application logs as follow. how can i resolve this issue.

 ![image](https://forum-prod-assets20231213123829991800000001.s3.dualstack.us-east-1.amazonaws.com/original/1X/c1da931c974e83046f6ced25bcb757c7a41b41e4.png)

---

<div class="post-metadata">

**Author:** ![rnarayanan](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/rnarayanan/32/213_2.png) [@rnarayanan](https://www.singlestore.com/forum/u/rnarayanan)\
**Post date:** [April 3, 2020, 11:48pm UTC](https://www.singlestore.com/forum/t/spark-connector-run-error/1626/2 "2020-04-03T23:48:21Z")

</div>

Hello Juoon,

Sorry for the late response. Can you see if our current doc on Spark is helpful? Here is the link [SingleStoreDB Cloud · SingleStore Documentation](https://docs.memsql.com/v7.0/guides/client-and-application/third-party-integrations/spark-connector/)

Our engineering has also released a new connector on GitHub for Spark - Beta version. Here is that link [https://github.com/memsql/memsql-spark-connector/tree/3.0.0-beta](https://github.com/memsql/memsql-spark-connector/tree/3.0.0-beta)

Here is the doc link for the above connector

> **[SingleStoreDB Cloud · SingleStore Documentation](https://docs.singlestore.com/v7.0/guides/client-and-application/third-party-integrations/spark-3-connector/)**
>
> SingleStore is a modern relational database for cloud and on-premises that delivers immediate insights for modern applications and analytical systems. Book a demo or trial today!

Hope this is helpful. Let us know how you ultimately implemented your solution.

Thanks,
