I'm new to Spark and Scala, and I am trying to read a bunch of tweeter data from a JSON file and turn that into a graph where a vertex represents a tweet and the edge connects to tweets which are a re-tweet of the original posted item. So far I have managed to read from the JSON file and figure out the Schema of my RDD. Now I believe I need to somehow take the data from the SchemaRDD object and create an RDD for the Vertices and an RDD for the edges. Is this the way to approach this or is there an alternative solution? Any help and suggestions would be highly appreciated.
相关问题
- How to maintain order of key-value in DataFrame sa
- Spark on Yarn Container Failure
- In Spark Streaming how to process old data and del
- Filter from Cassandra table by RDD values
- How to determine +/- sign when calculating diagona
相关文章
- Livy Server: return a dataframe as JSON?
- Mercurial Commit Charts / Graphs [closed]
- SQL query Frequency Distribution matrix for produc
- How to filter rows for a specific aggregate with s
- How to name file when saveAsTextFile in spark?
- Spark save(write) parquet only one file
- Could you give me any clue Why 'Cannot call me
- Why does the Spark DataFrame conversion to RDD req
This really depends on your json file. You need to parse the data from the json file and create your vertices and edges based on the parsed data. There isnt a certain way to implement this, its really up to the programmer. One approach is to create a vertices array and edges array (again based on the parsed data) and parallelize those (create VertexRDD and EdgeRDD), and then create the graph you need. Hope I helped.