Graphx CompactBuffer help

2015-08-28 Thread smagadi
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

Re: SPARK sql :Need JSON back isntead of roq

2015-08-21 Thread smagadi
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 age19 and age =30 ).toJSON x.collect().foreach(println)

SPARK SQL support for XML

2015-08-21 Thread smagadi
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.

Re: SparkR -Graphx Connected components

2015-08-10 Thread smagadi
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 =

SparkR -Graphx Cliques

2015-08-10 Thread smagadi
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.

SparkR -Graphx Connected components

2015-08-07 Thread smagadi
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, (Ed,

SparkR -Graphx

2015-08-06 Thread smagadi
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: