# Save data from Databricks to ElasticSearch Cloud

**URL:** <https://discuss.elastic.co/t/save-data-from-databricks-to-elasticsearch-cloud/216679>\
**Category:** Elasticsearch\
**Created:** [January 27, 2020, 3:04pm UTC](https://discuss.elastic.co/t/save-data-from-databricks-to-elasticsearch-cloud/216679 "2020-01-27T15:04:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoeb\_ansari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shoeb_ansari/32/48680_2.png) [@shoeb\_ansari](https://discuss.elastic.co/u/shoeb_ansari)\
**Post date:** [January 27, 2020, 3:04pm UTC](https://discuss.elastic.co/t/save-data-from-databricks-to-elasticsearch-cloud/216679/1 "2020-01-27T15:04:28Z")

</div>

While executing the Databricks notebook to save data in Elasticsearch cloud if you are getting below error:

` “org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot detect ES version - typically this happens if the network/Elasticsearch cluster is not accessible or when targeting a WAN/Cloud instance without the proper setting 'es.nodes.wan.”`

To solve this issue you have to pass the credential along with the URL of Elasticsearch.

> val esURL = "[https://elastic-url](https://elastic-url)"
> 
> val df = spark.read.option("header","true").csv("/mnt/akc\_breed\_info.csv")  
> df.write  
> .format("org.elasticsearch.spark.sql")  
> .option("es.nodes.wan.only","true")  
> .option("es.port","443")  
> .option("es.net.ssl","true")  
> .option("es.net.http.auth.user","uuuuu")  
> .option("es.net.http.auth.pass","ppppp")  
> .option("es.nodes", esURL)  
> .mode("Overwrite")  
> .save("index/dogs")

If you still face any issue please let me know.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 24, 2020, 3:11pm UTC](https://discuss.elastic.co/t/save-data-from-databricks-to-elasticsearch-cloud/216679/2 "2020-02-24T15:11:36Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
