use of org.apache.flink.graph.asm.translate.translators.ToNullValue in project flink by apache.
the class SummarizationITCase method testWithVertexAndAbsentEdgeStringValues.
@Test
public void testWithVertexAndAbsentEdgeStringValues() throws Exception {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Graph<Long, String, NullValue> input = Graph.fromDataSet(SummarizationData.getVertices(env), SummarizationData.getEdges(env), env).run(new TranslateEdgeValues<>(new ToNullValue<>()));
List<Vertex<Long, Summarization.VertexValue<String>>> summarizedVertices = new ArrayList<>();
List<Edge<Long, EdgeValue<NullValue>>> summarizedEdges = new ArrayList<>();
Graph<Long, Summarization.VertexValue<String>, EdgeValue<NullValue>> output = input.run(new Summarization<>());
output.getVertices().output(new LocalCollectionOutputFormat<>(summarizedVertices));
output.getEdges().output(new LocalCollectionOutputFormat<>(summarizedEdges));
env.execute();
validateVertices(SummarizationData.EXPECTED_VERTICES, summarizedVertices);
validateEdges(SummarizationData.EXPECTED_EDGES_ABSENT_VALUES, summarizedEdges);
}
Aggregations