I have an RDD[SubscriptionInfo] wher SubscriptionInfo is a defined as a case class .
I'm trying to save the rdd to ES and I want to specify the _id to use, so I'm using something like this:
rdd.saveToEs("spark/docs", Map("es.mapping.id" -> "sub_id"))
but I get an error:
Caused by: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: [ScalaMapFieldExtractor for field [[sub_id]]] cannot extract value from entity [class java.lang.String] | instance [Some(SubscriptionInfo(ea9db3d23862862e68886de79bd2d489_4307394759,None,Some(List(Billing(Sun May 07 00:03:06 UTC 2017,2.0,None))),None,None,2.0,EmptyLTV()))]
Which is the correct way to specify the mapping id in this case?