# What version of elasticsearch-hadoop should I be using with spark 4.0.1

**URL:** https://discuss.elastic.co/t/what-version-of-elasticsearch-hadoop-should-i-be-using-with-spark-4-0-1/382679
**Category:** Elasticsearch
**Tags:** docker, es-hadoop
**Created:** [October 14, 2025, 9:05am UTC](https://discuss.elastic.co/t/what-version-of-elasticsearch-hadoop-should-i-be-using-with-spark-4-0-1/382679 "2025-10-14T09:05:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas\_Butterfield](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_butterfield/32/145353_2.png) [@Thomas\_Butterfield](https://discuss.elastic.co/u/Thomas_Butterfield)
#### Post date: [October 14, 2025, 9:05am UTC](https://discuss.elastic.co/t/what-version-of-elasticsearch-hadoop-should-i-be-using-with-spark-4-0-1/382679/1 "2025-10-14T09:05:49Z")

</div>

Using Scala version 2.13.16 (OpenJDK 64-Bit Server VM, Java 17.0.16)

I'm getting this error when writing to an ES 8.19.3 cluster: `java.lang.NoSuchMethodError: 'org.apache.spark.sql.SQLContext org.apache.spark.sql.Dataset.sqlContext()'`

I was using org.elasticsearch:elasticsearch-spark-30\_2.13:8.17.0 before on spark 3.4 with no issues.

I've tried the latest versions of elasticsearch-hadoop for 8.x.x and 9.x.x all giving the above error.

Thank you

---

<div class="post-metadata">

### Author: ![Keith\_Massey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keith_massey/32/83666_2.png) [@Keith\_Massey](https://discuss.elastic.co/u/Keith_Massey)
#### Post date: [October 14, 2025, 1:13pm UTC](https://discuss.elastic.co/t/what-version-of-elasticsearch-hadoop-should-i-be-using-with-spark-4-0-1/382679/2 "2025-10-14T13:13:53Z")

</div>

Spark 4.x is not currently supported unfortunately.
