I have a spark dataframe which has a column say "name". The name could have different values in a single dataframe. When I write my data to elasticsearch using spark (scala), I want to write the data to different indexes based on the value of the column "name".
dataframe.saveToEs("index-name")
The saveToEs expects a string, I am looking for something on the lines of :
dataframe.saveToEs(col(""))
or something similar where I can assign the value during write time.