How to access _id from Spark SQL?



i would access elasticsearch _id field from a SQL request through Spark Shell.

I've try this request :

>  sqlContext.sql("select `_id`,platform,avg(duration),count(*) from video group by platform").show(100)

But it's not work. Others document fields work fine.

Thank for your help.

(Costin Leau) #2

By default, the document metadata is not returned. To do so, set to true as mentioned here


Exactly what i need.

Thank you.

(system) #4