Exporting graphs using DseGraphFrame

Use DseGraphFrame to export the graph to any format supported by Spark.

Use DseGraphFrame to export the graph to any format supported by Spark.

Procedure

  1. Start the Spark shell.
    dse spark
  2. Export the vertices and edges to a Spark-supported using the write method.

    Export the graph to JSON files in the DSEFS file system.

    val g = spark.dseGraph("gods_export")
    g.V.write.json("/tmp/v_json")
    g.E.write.json("/tmp/e_json")

    That will create two directories in the DSEFS file system with vertex and edge JSON files. You can get data locally if they are not too large for the local file system:

    dse hadoop fs -cat /tmp/v_json/* > local_vertices.json && 
    dse hadoop fs -cat /tmp/e_json/* > local_edges.json