Skip to content

Improve docs: GDS #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/ROOT/pages/faq.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Refer to xref:overview.adoc#_spark_and_scala_compatibility[this page] to know wh
This might happen when creating a new graph using the GDS library.
The issue here is that the query is run the first time to extract the DataFrame schema and then is run again to get the data.

To avoid this issue you can use the xref:quickstart.adoc#user-defined-schema[user defined schema] approach.
To avoid this issue you can use the xref:read/define-schema.adoc#custom-schema[user defined schema] approach.

== Databricks setup

Expand Down
7 changes: 3 additions & 4 deletions modules/ROOT/pages/gds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spark.read.format("org.neo4j.spark.DataSource")

which will show a result like this:

```bash
```
+------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------+-----------------+-------------+
|nodeProjection |relationshipProjection |graphName|nodeCount|relationshipCount|projectMillis|
+------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------+-----------------+-------------+
Expand Down Expand Up @@ -103,7 +103,7 @@ spark.read.format("org.neo4j.spark.DataSource")
----
(
spark.read.format("org.neo4j.spark.DataSource")
.option("gds", "gds.pageRank.stream")
.option("gds", "gds.pageRank.stream.estimate")
.option("gds.graphName", "myGraph")
.option("gds.configuration.concurrency", "2")
.load()
Expand Down Expand Up @@ -187,12 +187,11 @@ As you can see, we have now only the two columns `nodeId` and `score`, let's see
# we'll assume that `spark` variable is already present
# we create the `nodes_df`
nodes_df = spark.read.format("org.neo4j.spark.DataSource") \
.option("url", "neo4j://localhost:7687") \
.option("labels", "Page") \
.load()

# we join `nodes_df` with `pr_df` created in the step before
new_df = nodes_df.join(pr_df, nodes_df.col("<id>").equalTo(pr_df.col("nodeId")))
new_df = nodes_df.join(pr_df, nodes_df["<id>"] == pr_df["nodeId"])
new_df.show(truncate=False)
----

Expand Down