Skip to content

Instantly share code, notes, and snippets.

@geoHeil
Created December 3, 2017 22:22
Show Gist options
  • Save geoHeil/08d382fac091158af45ac756ed671846 to your computer and use it in GitHub Desktop.
Save geoHeil/08d382fac091158af45ac756ed671846 to your computer and use it in GitHub Desktop.
val friends: DataFrame = g.find("(a)-[e]->(b)")
friends.show
friends.groupBy('a).agg(mean($"b.fraud").as("fraud"))
.withColumn("id", $"a.id")
.withColumn("name", $"a.name")
.withColumn("fraud_src", $"a.fraud")
.drop("a")
.show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment