Spark sql insert json dataframe into elastic search

I've looked at the guide section for using spark SQL dataframe/dataset to insert json data into elastic search, but the section "Writing existing JSON to ElasticSearch" tells you to use sql load method, which gets data FROM elasticsearch to populate a dataframe in spark.

Link to section I am referring to:

I have spark log data and load that into a spark dataframe. I want to use elastic search spark library to bulk load that into elastic search. The closest I can get so far is pre aggregating the json data myself using spark and running dataframe.saveToEs("spark/.logs").

If I have val df ="hdfs path")
I should be able to use the json schema as it has been worked out already.

What json save to Es method can I use?


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