diff --git a/spark/pagerank_example.ipynb b/spark/pagerank_example.ipynb index d57ab16..432d094 100644 --- a/spark/pagerank_example.ipynb +++ b/spark/pagerank_example.ipynb @@ -38,6 +38,7 @@ "metadata": {}, "outputs": [], "source": [ + "# option 0: read graph data for one type of edge, scan from all storaged instances\n", "df = spark.read.format(\n", " \"com.vesoft.nebula.connector.NebulaDataSource\").option(\n", " \"type\", \"edge\").option(\n", @@ -46,9 +47,29 @@ " \"returnCols\", \"degree\").option(\n", " \"metaAddress\", \"metad0:9559\").option(\n", " \"partitionNumber\", 1).load()\n", + "\n", + "# option 1: read graph data with ngql, get data from graphd\n", + "df = spark.read.format(\n", + " \"com.vesoft.nebula.connector.NebulaDataSource\").option(\n", + " \"type\", \"edge\").option(\n", + " \"spaceName\", \"basketballplayer\").option(\n", + " \"label\", \"follow\").option(\n", + " \"returnCols\", \"degree\").option(\n", + " \"metaAddress\", \"metad0:9559\").option(\n", + " \"graphAddress\", \"graphd:9669\").option(\n", + " \"ngql\", \"MATCH ()-[e:follow]->() return e LIMIT 1000\").option(\n", + " \"partitionNumber\", 1).load()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "31871548", + "metadata": {}, + "outputs": [], + "source": [ "# prConfig = PRConfig(3, 0.85)\n", - "prConfig = spark._jvm.PRConfig(3, 0.85)\n", - "\n" + "prConfig = spark._jvm.PRConfig(3, 0.85)" ] }, {