after running the below code
val
coonn=graph.connectedComponents.vertices.map(_.swap).groupByKey.map(_._2).collect()
coonn.foreach(println)
I get array of compact buffers
CompactBuffer(13)
CompactBuffer(14)
CompactBuffer(4, 11, 1, 6, 3, 7, 9, 8, 10, 5, 2)
CompactBuffer(15, 12)
Now i want to g
teenagers .toJSON gives the json but it does not preserve the parent ids
meaning if the input was {"name":"Yin",
"address":{"city":"Columbus","state":"Ohio"},"age":20}
val x= sqlContext.sql("SELECT name, address.city, address.state ,age FROM
people where age>19 and age <=30 ").toJSON
x.collect
Does spark sql supports XML the same way as it supports json ?
--
View this message in context:
http://apache-spark-user-list.1001560.n3.nabble.com/SPARK-SQL-support-for-XML-tp24382.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
--
val teenagers = sqlContext.sql("SELECT name FROM people WHERE age >= 13 AND
age <= 19")
I need teenagers to be a JSON object rather a simple row .How can we get
that done ?
--
View this message in context:
http://apache-spark-user-list.1001560.n3.nabble.com/SPARK-sql-Need-JSON-back-isntead-of-
How to find the cliques using spark graphx ? a quick code snippet is
appreciated.
--
View this message in context:
http://apache-spark-user-list.1001560.n3.nabble.com/SparkR-Graphx-Cliques-tp24191.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
--
Thanks for the response Robin
is this the same for both Directed and undirected graphs ?
val edges =
Array(0L -> 1L, 1L -> 2L, 2L -> 0L) ++
Array(3L -> 4L, 4L -> 5L, 5L -> 3L) ++
Array(6L -> 0L, 5L -> 7L)
val rawEdges = sc.parallelize(edges)
val graph = Graph.fro
Hi I was trying to use stronglyconnectcomponents ()
Given a DAG is graph I was supposed to get back list of stronglyconnected l
comps .
def main(args: Array[String])
{
val vertexArray = Array(
(1L, ("Alice", 28)),
(2L, ("Bob", 27)),
(3L, ("Charlie", 65)),
(4L, ("David", 42)),
(5L,
Wanted to use the GRaphX from SparkR , is there a way to do it ?.I think as
of now it is not possible.I was thinking if one can write a wrapper in R
that can call Scala Graphx libraries .
Any thought on this please.
--
View this message in context:
http://apache-spark-user-list.1001560.n3.nabbl