[ 
https://issues.apache.org/jira/browse/FLINK-3771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15262147#comment-15262147
 ] 

ASF GitHub Bot commented on FLINK-3771:
---------------------------------------

Github user vasia commented on the pull request:

    https://github.com/apache/flink/pull/1900#issuecomment-215428452
  
    Hi @greghogan,
    
    I feel we're over-engineering something that should be way simpler... 
Translators are just a set of `MapFunction`s applied on vertex or edge ids and 
values. I think that the current API is way too complex for what it does, e.g.
    `graph.run(new 
TranslateEdgeValues<LongValue,LongValue,LongValue,StringValue>(new 
LongValueToStringValue()))` seems too verbose to me for mapping an edge value.
    It could be as simple as `graph.mapEdges(new LongValueToStringValue())`.
    
    Also, I don't think we need 6 methods. We could either add 4 methods to 
`Graph`, i.e. `mapVertexIDs`, `mapVertexValues`, `mapEdgeIds`, `mapEdgeValues` 
or extend the `mapEdges` and `mapVertices` methods. In the latter case, we will 
have to provide specialized mappers as you note above, e.g. 
`MapVertexValueLongToString`, `MapEdgeValueLongToString`, etc., but these can 
internally wrap the same mapper.
    
    Please let me know your thought on this! Thanks!


> 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)

Reply via email to