srowen commented on a change in pull request #26498: [SPARK-29872] Improper
cache strategy in examples
URL: https://github.com/apache/spark/pull/26498#discussion_r345758135
##########
File path: examples/src/main/scala/org/apache/spark/examples/SparkTC.scala
##########
@@ -55,20 +55,24 @@ object SparkTC {
// the graph to obtain the path (x, z).
// Because join() joins on keys, the edges are stored in reversed order.
- val edges = tc.map(x => (x._2, x._1))
+ val edges = tc.map(x => (x._2, x._1)).cache()
Review comment:
This is more complex for an example, but, I think it's reasonably important
to show this pattern in this type of example.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]