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 fs "cat /tmp/v_json/* > file:/home/username/local_vertices.json" && 
    dse fs "cat /tmp/e_json/* > file:/home/username/local_edges.json"