[
https://issues.apache.org/jira/browse/FLINK-3771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15258288#comment-15258288
]
ASF GitHub Bot commented on FLINK-3771:
---------------------------------------
Github user greghogan commented on the pull request:
https://github.com/apache/flink/pull/1900#issuecomment-214782976
Hi @vasia,
Comparing the APIs, `Translate` processes at the level of label or value
whereas `mapVertices/Edges` process vertices and edges. What are use cases for
the extra context (namely, the label) provided by `mapVertices/Edges`?
Implementations of `Translator` can be reused across functions whereas the
`MapFunction` provided to `mapVertices/Edges` are specific to that method.
Would `mapLabels` require two new `MapFunction` or use an interface like
`Translator`?
`Translator` is wrapped by a specific `MapFunction` for each `Translate`
function.
Only one of the five current `Translate` functions operates on a `Graph`.
`tranlateGraphLabels` could be moved to `Graph`, and there could be a
`translateVertexValues` and `translateEdgeValues` also added to `Graph`. We
don't always have a `Graph`, sometimes algorithms return a `DataSet` of
vertices or edges, so having the static methods is helpful for these
specialized `Vertex` and `Edge` operations.
> Methods for translating Graphs
> ------------------------------
>
> Key: FLINK-3771
> URL: https://issues.apache.org/jira/browse/FLINK-3771
> Project: Flink
> Issue Type: New Feature
> Components: Gelly
> Affects Versions: 1.1.0
> Reporter: Greg Hogan
> Assignee: Greg Hogan
> Fix For: 1.1.0
>
>
> Provide methods for translation of the type or value of graph labels, vertex
> values, and edge values.
> Sample use cases:
> * shifting graph labels in order to union generated graphs or graphs read
> from multiple sources
> * downsizing labels or values since algorithms prefer to generate wide types
> which may be expensive for further computation
> * changing label type for testing or benchmarking alternative code paths
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)