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.
Spark GraphX - How can I read from a JSON file in Spark and create a graph from the data?
1.2k Views Asked by Adelina Balasa At
1
There are 1 best solutions below
Related Questions in GRAPH
- Find a MST in O(V+E) Time in a Graph
- Using chart and tooltip
- What clustering algorithms can I consider for graph?
- Clustering on Graph (using Boost Graph Library)
- How to set a domain on an axis and have the axis intervals not constant or take up different amount of interval spaces using d3
- sort graph by distance to end nodes
- Construct and label a uniform graph in NetworkX using dictionaries?
- Plot: Add legend that overlay several Frames
- Labelling nodes in networkx
- Plotting a data frame in R
- How does boost::subgraph work? Can we use filtered graph?
- How do I make a decaying oscilating function in python?
- Deserialize tree given inorder format?
- Having issues with D3 scale and data binding
- ArangoDB graph operations via REST API
Related Questions in APACHE-SPARK
- Spark .mapValues setup with multiple values
- Where do 'normal' println go in a scala jar, under Spark
- How to query JSON data according to JSON array's size with Spark SQL?
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- How to add a new event to Apache Spark Event Log
- Spark streaming + kafka throughput
- dataframe or sqlctx (sqlcontext) generated "Trying to call a package" error
- Spark pairRDD not working
- How to know which worker a partition is executed at?
- Using HDFS with Apache Spark on Amazon EC2
- How to create a executable jar reading files from local file system
- How to keep a SQLContext instance alive in a spark streaming application's life cycle?
- Cassandra spark connector data loss
- Proper way to provide spark application a parameter/arg with spaces in spark-submit
- sorting RDD elements
Related Questions in RDD
- How to know which worker a partition is executed at?
- sorting RDD elements
- Spark: Work around nested RDD
- Spark - Combinations without repetition
- Map a table of a cassandra database using spark and RDD
- When using textFile to create an RDD in Spark, what is the index that is displayed in the result?
- In Spark, what is left in the memory after a Job is done?
- Unexpected spark caching behavior
- Python function to convert a list RDD into a pair RDD with the unique words and their count?
- Scala - sort RDD partitions
- Spark read file from S3 using sc.textFile ("s3n://...)
- Avoid RDD nested in Spark without Array
- Spark rdd write in global list
- ReduceByKey with a byte array as the key
- apache spark - creating RDD from Iterable from groupByKey results
Related Questions in SPARK-GRAPHX
- traversing a graph in spark-graphx via edge properties
- Spark GraphX memory out of error SparkListenerBus (java.lang.OutOfMemoryError: Java heap space)
- Connecting the first two nodes with an edge from two RDDs in GraphX
- Subtract an RDD from another RDD doesn't work correctly
- Passing a function foreach key of an Array
- Graphx EdgeRDD count taking long time to compute
- How to create EdgeRDD in Graphx
- Does Spark Graphx have visualization like Gephi
- Retrieving TriangleCount
- removing vertices with no edges in graphx spark
- VertexRDD giving me type mismatch error
- Apache Spark Graphx :Source and Destination share the shame VertexId but represnet different things
- Spark Graphx: Loading a graph from adjacency matrix
- Apache spark Graphx :GraphLoader minEdgePartitions selection
- GraphX not working properly Spark / Scala
Related Questions in PROPERTY-GRAPH
- Neo4j MATCH then MERGE too many DB hits
- What kinds of use cases are ideal for SPARQL / RDF triple stores, but not property graphs?
- What is the best way to perform soft delete in Graph database?
- Property graph (Neo4j) design: Single node with multiple relations or new nodes for each event occurence?
- Neo4j cypher query for linked list
- What is best way to implement multi-lingual / internationalization in Graph database?
- Neo4j - encountering FetchURLError whenever using any query with GET or POST
- Watch updates in redis graph
- How to efficiently delete nodes which can be reached from another node without passing other nodes and only have 1 incoming relationship?
- Are there any collaborative data modelling tools for a property graph model that can import into neo4j
- Error while creating node using py2neo : keyword can't be an expression
- Litte expressivity of Property Graphs compared to RDF Graphs due to lack of reification?
- Data model for Graph database AWS neptune
- Cypher query in a neo4j graph
- Graph exploration: does the choice to use incoming edges or outgoing edges affect performance?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
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.