我正在檢查將Spark GraphX圖導出到Titan圖形數據庫的可行性。我們可以將Spark GraphX圖形數據導出到Titan圖形數據庫嗎?
***Used below code to construct graph in Spark GraphX and writing graph to a json file :***
val conf = new SparkConf()
val sc = new SparkContext(conf.setAppName("========= GraphXTest ======="))
// Create an RDD for the vertices
val users: RDD[(VertexId, (String, String))] = sc.parallelize(Array(
(3L, ("rxin", "student")),
(7L, ("jgonzal", "postdoc")),
(5L, ("franklin", "prof"))
))
// Create an RDD for edges
val relationships: RDD[Edge[String]] = sc.parallelize(Array(
Edge(3L, 7L, "collab"),
Edge(5L, 3L, "advisor")
))
// Build the initial Graph
val graph = Graph(users, relationships)
graph.vertices.saveAsTextFile("D://Spark-GraphX-vertices.json")
在運行它,我提到d名稱創建文件夾上面的代碼://Spark-GraphX-vertices.json和內部的一些其他文件。但是這些文件不包含任何數據。
如何將此圖表從Spark GraphX導出到Titan數據庫?
感謝馬爾科A.羅德里格斯。我會檢查這一點 –