Save json file to elasticsearch using spark?

I am trying to save a json file to Elasticsearch, I am getting this error (Exception in thread "main" java.lang.AbstractMethodError) I am using "spark 2.3.0" and "scala 2.11.6" please find the code Below:
//
import org.apache.spark.sql.SQLContext
import org.elasticsearch.spark.sql._

import org.apache.spark.{SparkConf, SparkContext}

object OrangetoES {

def main(args: Array[String]) {
val conf = new SparkConf().setAppName("OrangetoES").setMaster("local[*]")
val sc = new SparkContext(conf)
conf.set("es.index.auto.create", "true")
val sqlc = new SQLContext(sc)
val df = sqlc.read.json("../Orange.json")
df.saveToEs("orangetoes/people")

}

}
//

help me to solve this problem

Can you include the full exception trace and message text here?

thanks @james.baiera it work fine now :slight_smile:

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