How to use ElasticSearch hadoop connector to create type automatically from Streaming DataSet ?
I have the following code.
df .writeStream() .outputMode("append") .trigger(Trigger.ProcessingTime(1000)) .format("org.elasticsearch.spark.sql") .option("checkpointLocation", "/tmp") .start("test/hello");
I want test index and hello type to be created automatically given my dataframe
df. I dont have test index and hello type created prior to running my spark streaming job
so When I run the code above I get the following error
Caused by: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost, executor driver): org.apache.spark.util.TaskCompletionListenerException: Found unrecoverable error [127.0.0.1:9200] returned Not Found(404) - type[hello] missing; Bailing out..