Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/967#discussion_r13372785
--- Diff: graphx/src/main/scala/org/apache/spark/graphx/Graph.scala ---
@@ -131,6 +131,19 @@ abstract class Graph[VD: ClassTag, ED: ClassTag]
protected () extends Serializab
def mapVertices[VD2: ClassTag](map: (VertexId, VD) => VD2): Graph[VD2,
ED]
/**
+ * Transforms each vertex attribute in the graph using the map function.
Like [[mapVertices]], but
+ * since the type is conserved, is able to avoid moving unchanged vertex
attributes when updating
+ * the triplets view.
+ *
+ * @note The new graph has the same structure. As a consequence the
underlying index structures
+ * can be reused.
+ *
+ * @param map the function from a vertex object to a new vertex value of
the same type
+ *
+ */
+ def mapVerticesConserve(map: (VertexId, VD) => VD): Graph[VD, ED]
--- End diff --
Would TypeTags solve this problem?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---