Details
Description
val gson = new com.google.gson.Gson()
val bubbles = sqlContext.sql(s"""select * from social""").map(r=>
Map(
"city" -> r(0).toString,
"latitude" -> r(1).toString.toDouble,
"longitude" -> r(2).toString.toDouble
)
).collect.map(s=>scala.collection.JavaConversions.mapAsJavaMap(s))
val bubblesJson = gson.toJson(bubbles)