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

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

Github user andralungu commented on a diff in the pull request:

    https://github.com/apache/flink/pull/807#discussion_r31932709
  
    --- Diff: 
flink-staging/flink-gelly/src/test/java/org/apache/flink/graph/test/operations/GraphOperationsITCase.java
 ---
    @@ -266,6 +266,47 @@ public void testUnion() throws Exception {
                                        "6,1,61\n";
        }
     
    +    @Test
    +    public void testDifference() throws Exception {
    +           /*
    +            * Test difference()
    +            */
    +        final ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
    +
    +        Graph<Long, Long, Long> graph = 
Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
    +                TestGraphUtils.getLongLongEdgeData(env), env);
    +
    +        List<Vertex<Long, Long>> vertices = new ArrayList<Vertex<Long, 
Long>>();
    +        List<Edge<Long, Long>> edges = new ArrayList<Edge<Long, Long>>();
    +
    +        vertices.remove(1);
    +        vertices.remove(3);
    +        vertices.remove(4);
    +
    +        vertices.add(new Vertex<Long,Long>(6L,6L));
    +
    +        edges.remove(0);
    +        edges.remove(2);
    +        edges.remove(3);
    +        edges.remove(4);
    +        edges.remove(5);
    +        edges.remove(6);
    +
    +        edges.add(new Edge<Long, Long>(6L,1L,61L));
    +        edges.add(new Edge<Long, Long>(6L,3L,63L));
    +
    +        graph = graph.difference(Graph.fromCollection(vertices, edges, 
env));
    +
    +        graph.getEdges().writeAsCsv(resultPath);
    +        graph.getVertices().writeAsCsv(resultPath);
    --- End diff --
    
    The graph.getVertices() should actually be in a different test; that way 
you could change the expected result and see that the vertices you get are 
actually the ones you expected.


> Add a difference method to Gelly's Graph class
> ----------------------------------------------
>
>                 Key: FLINK-2093
>                 URL: https://issues.apache.org/jira/browse/FLINK-2093
>             Project: Flink
>          Issue Type: New Feature
>          Components: Gelly
>    Affects Versions: 0.9
>            Reporter: Andra Lungu
>            Assignee: Shivani Ghatge
>            Priority: Minor
>
> This method will compute the difference between two graphs, returning a new 
> graph containing the vertices and edges that the current graph and the input 
> graph don't have in common. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to