org.apache.flink.api.java.operators.MapOperator.union()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.apache.flink.api.java.operators.MapOperator.union()方法的一些代码示例,展示了MapOperator.union()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MapOperator.union()方法的具体详情如下:
包路径:org.apache.flink.api.java.operators.MapOperator
类名称:MapOperator
方法名:union

MapOperator.union介绍

暂无

代码示例

代码示例来源:origin: apache/flink

iteration.map(new IdentityMapper<Long>()).union(iteration.map(new IdentityMapper<Long>())))
.output(new DiscardingOutputFormat<Long>());

代码示例来源:origin: apache/flink

iter.closeWith(
    iter.getWorkset().map(new IdentityMapper<Tuple2<Long,Long>>())
  .union(
    iter.getWorkset().map(new IdentityMapper<Tuple2<Long,Long>>()))
  , iter.getWorkset().map(new IdentityMapper<Tuple2<Long,Long>>())
  .union(
      iter.getWorkset().map(new IdentityMapper<Tuple2<Long,Long>>()))

代码示例来源:origin: apache/flink

.map(new IdentityMapper<Tuple2<Long,Long>>())
  .withBroadcastSet(bc_input1, "bc1")
.union(joinResult)
.output(new DiscardingOutputFormat<Tuple2<Long, Long>>());

代码示例来源:origin: dbs-leipzig/gradoop

/**
 * Counts the elements in the given dataset and stores the result in a
 * 1-element dataset.
 *
 * @param dataSet input dataset
 * @param <T>     element type in input dataset
 * @return 1-element dataset with count of input dataset
 */
public static <T> DataSet<Long> count(DataSet<T> dataSet) {
 return dataSet
  .map(new Tuple1With1L<T>())
  .union(dataSet.getExecutionEnvironment().fromElements(new Tuple1<>(0L)))
  .sum(0)
  .map(new ValueOf1<>());
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
 * Counts the elements in the given dataset and stores the result in a
 * 1-element dataset.
 *
 * @param dataSet input dataset
 * @param <T>     element type in input dataset
 * @return 1-element dataset with count of input dataset
 */
public static <T> DataSet<Long> count(DataSet<T> dataSet) {
 return dataSet
  .map(new Tuple1With1L<T>())
  .union(dataSet.getExecutionEnvironment().fromElements(new Tuple1<>(0L)))
  .sum(0)
  .map(new ValueOf1<>());
}

代码示例来源:origin: dbs-leipzig/gradoop

/**
 * Returns the subgraph of the given supergraph that is induced by the
 * edges that fulfil the given filter function.
 *
 * @param superGraph supergraph
 * @return edge-induced subgraph
 */
private LG edgeInducedSubgraphProjectFirst(LG superGraph) {
 DataSet<E> filteredEdges = superGraph.getEdges().filter(edgeFilterFunction);
 DataSet<Tuple1<GradoopId>> vertexIdentifiers = filteredEdges
  .map(new SourceId<>())
  .map(new ObjectTo1<>())
  .union(filteredEdges
   .map(new TargetId<>())
   .map(new ObjectTo1<>()))
  .distinct();
 DataSet<V> filteredVertices = vertexIdentifiers
  .join(superGraph.getVertices())
  .where(0).equalTo(new Id<>())
  .with(new RightSide<>());
 return superGraph.getFactory().fromDataSets(filteredVertices, filteredEdges);
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
 * Returns the subgraph of the given supergraph that is induced by the
 * edges that fulfil the given filter function.
 *
 * @param superGraph supergraph
 * @return edge-induced subgraph
 */
private LG edgeInducedSubgraphProjectFirst(LG superGraph) {
 DataSet<E> filteredEdges = superGraph.getEdges().filter(edgeFilterFunction);
 DataSet<Tuple1<GradoopId>> vertexIdentifiers = filteredEdges
  .map(new SourceId<>())
  .map(new ObjectTo1<>())
  .union(filteredEdges
   .map(new TargetId<>())
   .map(new ObjectTo1<>()))
  .distinct();
 DataSet<V> filteredVertices = vertexIdentifiers
  .join(superGraph.getVertices())
  .where(0).equalTo(new Id<>())
  .with(new RightSide<>());
 return superGraph.getFactory().fromDataSets(filteredVertices, filteredEdges);
}

代码示例来源:origin: dbs-leipzig/gradoop

.union(result.getEdges()
 .map(new ExpandGraphsToIdSet<>()))
.union(result.getGraphHead()

代码示例来源:origin: org.gradoop/gradoop-flink

/**
 * Verifies that the given graph is consistent, contains only edges that connect to vertices
 * within the subgraph.
 *
 * @param subgraph supergraph
 * @return verified subgraph
 */
private LG verify(LG subgraph) {
 DataSet<Tuple2<Tuple2<E, V>, V>> verifiedTriples = subgraph.getEdges()
  .join(subgraph.getVertices())
  .where(new SourceId<>()).equalTo(new Id<>())
  .join(subgraph.getVertices())
  .where("0.targetId").equalTo(new Id<>());
 DataSet<E> verifiedEdges = verifiedTriples
  .map(new Value0Of2<>())
  .map(new Value0Of2<>());
 DataSet<V> verifiedVertices = verifiedTriples
  .map(new Value0Of2<>())
  .map(new Value1Of2<>())
  .union(verifiedTriples.map(new Value1Of2<>()))
  .distinct(new Id<>());
 return subgraph.getFactory().fromDataSets(verifiedVertices, verifiedEdges);
}

代码示例来源:origin: dbs-leipzig/gradoop

/**
  * Verifies that the given graph is consistent, contains only edges that connect to vertices
  * within the subgraph.
  *
  * @param subgraph supergraph
  * @return verified subgraph
  */
 private LG verify(LG subgraph) {

  DataSet<Tuple2<Tuple2<E, V>, V>> verifiedTriples = subgraph.getEdges()
   .join(subgraph.getVertices())
   .where(new SourceId<>()).equalTo(new Id<>())
   .join(subgraph.getVertices())
   .where("0.targetId").equalTo(new Id<>());

  DataSet<E> verifiedEdges = verifiedTriples
   .map(new Value0Of2<>())
   .map(new Value0Of2<>());

  DataSet<V> verifiedVertices = verifiedTriples
   .map(new Value0Of2<>())
   .map(new Value1Of2<>())
   .union(verifiedTriples.map(new Value1Of2<>()))
   .distinct(new Id<>());

  return subgraph.getFactory().fromDataSets(verifiedVertices, verifiedEdges);
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

.union(logicalGraph.getVertices());

代码示例来源:origin: org.gradoop/gradoop-flink

.with(new LeftSide<>())
.map(new Value0Of2<>())
.union(vi)
.map(new MapFunctionAddGraphElementToGraph2<>(newGraphid));

代码示例来源:origin: dbs-leipzig/gradoop

.with(new LeftSide<>())
.map(new Value0Of2<>())
.union(vi)
.map(new MapFunctionAddGraphElementToGraph2<>(newGraphid));

相关文章