.leftOuterJoin(getFilteredDataSet(env), joinHint) .where(0) .equalTo(0) .with(new OverwriteObjectsJoin()) .collect(); .leftOuterJoin(getFilteredDataSet(env), joinHint) .where(0) .equalTo(0) .with(new OverwriteObjectsJoin()) .collect(); .rightOuterJoin(getFilteredDataSet(env), joinHint) .where(0) .equalTo(0) .with(new OverwriteObjectsJoin()) .collect(); .rightOuterJoin(getFilteredDataSet(env), joinHint) .where(0) .equalTo(0) .with(new OverwriteObjectsJoin()) .collect(); .fullOuterJoin(getFilteredDataSet(env), joinHint) .where(0) .equalTo(0) .with(new OverwriteObjectsJoin()) .collect();
.leftOuterJoin(secondGraph.getVertices()) .where(new Id<>()) .equalTo(new Id<>()) .with(new LeftWhenRightIsNull<>());
.leftOuterJoin(sourceDegree) .where(0) .equalTo(0) .with(new JoinVertexWithVertexDegree<>()) .setParallelism(parallelism)
@Override public DataSet<Vertex<K, Degrees>> runInternal(Graph<K, VV, EV> input) throws Exception { // s, t, bitmask DataSet<Tuple2<K, ByteValue>> vertexWithEdgeOrder = input.getEdges() .flatMap(new EmitAndFlipEdge<>()) .setParallelism(parallelism) .name("Emit and flip edge") .groupBy(0, 1) .reduceGroup(new ReduceBitmask<>()) .setParallelism(parallelism) .name("Reduce bitmask"); // s, d(s) DataSet<Vertex<K, Degrees>> vertexDegrees = vertexWithEdgeOrder .groupBy(0) .reduceGroup(new DegreeCount<>()) .setParallelism(parallelism) .name("Degree count"); if (includeZeroDegreeVertices.get()) { vertexDegrees = input.getVertices() .leftOuterJoin(vertexDegrees) .where(0) .equalTo(0) .with(new JoinVertexWithVertexDegrees<>()) .setParallelism(parallelism) .name("Zero degree vertices"); } return vertexDegrees; }
@Override public DataSet<Boolean> execute(GraphCollection firstCollection, GraphCollection secondCollection) { DataSet<Tuple1<GradoopId>> distinctFirstGraphIds = firstCollection .getGraphHeads() .map(new Id<GraphHead>()) .distinct() .map(new ObjectTo1<>()); DataSet<Tuple1<GradoopId>> distinctSecondGraphIds = secondCollection .getGraphHeads() .map(new Id<GraphHead>()) .distinct() .map(new ObjectTo1<>()); DataSet<Boolean> d = distinctFirstGraphIds .fullOuterJoin(distinctSecondGraphIds) .where(0).equalTo(0) .with(new OneSideEmpty<Tuple1<GradoopId>, Tuple1<GradoopId>>()) .union(firstCollection.getConfig() .getExecutionEnvironment() .fromElements(false) ); return Not.map(Or.reduce(d)); } }
@Override public DataSet<Boolean> execute(GraphCollection firstCollection, GraphCollection secondCollection) { DataSet<Tuple1<GradoopId>> distinctFirstGraphIds = firstCollection .getGraphHeads() .map(new Id<GraphHead>()) .distinct() .map(new ObjectTo1<>()); DataSet<Tuple1<GradoopId>> distinctSecondGraphIds = secondCollection .getGraphHeads() .map(new Id<GraphHead>()) .distinct() .map(new ObjectTo1<>()); DataSet<Boolean> d = distinctFirstGraphIds .fullOuterJoin(distinctSecondGraphIds) .where(0).equalTo(0) .with(new OneSideEmpty<Tuple1<GradoopId>, Tuple1<GradoopId>>()) .union(firstCollection.getConfig() .getExecutionEnvironment() .fromElements(false) ); return Not.map(Or.reduce(d)); }
@Override public DataSet<GraphTransaction> getGraphTransactions() { DataSet<Tuple2<GradoopId, GraphElement>> graphVertexTuples = getVertices() .map(new Cast<>(GraphElement.class)) .returns(TypeExtractor.getForClass(GraphElement.class)) .flatMap(new GraphElementExpander<>()); DataSet<Tuple2<GradoopId, GraphElement>> graphEdgeTuples = getEdges() .map(new Cast<>(GraphElement.class)) .returns(TypeExtractor.getForClass(GraphElement.class)) .flatMap(new GraphElementExpander<>()); DataSet<Tuple3<GradoopId, Set<Vertex>, Set<Edge>>> transactions = graphVertexTuples .union(graphEdgeTuples) .groupBy(0) .combineGroup(new GraphVerticesEdges()) .groupBy(0) .reduceGroup(new GraphVerticesEdges()); return getGraphHeads() .leftOuterJoin(transactions) .where(new Id<>()).equalTo(0) .with(new TransactionFromSets()); }
@Override public DataSet<GraphTransaction> getGraphTransactions() { DataSet<Tuple2<GradoopId, GraphElement>> graphVertexTuples = getVertices() .map(new Cast<>(GraphElement.class)) .returns(TypeExtractor.getForClass(GraphElement.class)) .flatMap(new GraphElementExpander<>()); DataSet<Tuple2<GradoopId, GraphElement>> graphEdgeTuples = getEdges() .map(new Cast<>(GraphElement.class)) .returns(TypeExtractor.getForClass(GraphElement.class)) .flatMap(new GraphElementExpander<>()); DataSet<Tuple3<GradoopId, Set<Vertex>, Set<Edge>>> transactions = graphVertexTuples .union(graphEdgeTuples) .groupBy(0) .combineGroup(new GraphVerticesEdges()) .groupBy(0) .reduceGroup(new GraphVerticesEdges()); return getGraphHeads() .leftOuterJoin(transactions) .where(new Id<>()).equalTo(0) .with(new TransactionFromSets()); }
/** * Continues a Join transformation. * * <p>Defines the {@link Tuple} fields of the first join {@link DataSet} that should be used as join keys. * * <p><b>Note: Fields can only be selected as join keys on Tuple DataSets.</b> * * @param fields The indexes of the other Tuple fields of the first join DataSets that should be used as keys. * @return An incomplete Join transformation. * Call {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(int...)} or * {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(KeySelector)} * to continue the Join. * * @see Tuple * @see DataSet */ public JoinOperatorSetsPredicateBase where(int... fields) { return new JoinOperatorSetsPredicateBase(new Keys.ExpressionKeys<>(fields, input1.getType())); }
/** * Continues a Join transformation. * * <p>Defines the {@link Tuple} fields of the first join {@link DataSet} that should be used as join keys. * * <p><b>Note: Fields can only be selected as join keys on Tuple DataSets.</b> * * @param fields The indexes of the other Tuple fields of the first join DataSets that should be used as keys. * @return An incomplete Join transformation. * Call {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(int...)} or * {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(KeySelector)} * to continue the Join. * * @see Tuple * @see DataSet */ public JoinOperatorSetsPredicateBase where(int... fields) { return new JoinOperatorSetsPredicateBase(new Keys.ExpressionKeys<>(fields, input1.getType())); }
/** * Continues a Join transformation and defines a {@link KeySelector} function for the first join {@link DataSet}. * * <p>The KeySelector function is called for each element of the first DataSet and extracts a single * key value on which the DataSet is joined. * * @param keySelector The KeySelector function which extracts the key values from the DataSet on which it is joined. * @return An incomplete Join transformation. * Call {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(int...)} or * {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(KeySelector)} * to continue the Join. * * @see KeySelector * @see DataSet */ public <K> JoinOperatorSetsPredicateBase where(KeySelector<I1, K> keySelector) { TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keySelector, input1.getType()); return new JoinOperatorSetsPredicateBase(new Keys.SelectorFunctionKeys<>(keySelector, input1.getType(), keyType)); }
/** * Continues a Join transformation and defines a {@link KeySelector} function for the first join {@link DataSet}. * * <p>The KeySelector function is called for each element of the first DataSet and extracts a single * key value on which the DataSet is joined. * * @param keySelector The KeySelector function which extracts the key values from the DataSet on which it is joined. * @return An incomplete Join transformation. * Call {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(int...)} or * {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(KeySelector)} * to continue the Join. * * @see KeySelector * @see DataSet */ public <K> JoinOperatorSetsPredicateBase where(KeySelector<I1, K> keySelector) { TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keySelector, input1.getType()); return new JoinOperatorSetsPredicateBase(new Keys.SelectorFunctionKeys<>(keySelector, input1.getType(), keyType)); }
/** * Continues a Join transformation. * * <p>Defines the fields of the first join {@link DataSet} that should be used as grouping keys. Fields * are the names of member fields of the underlying type of the data set. * * @param fields The fields of the first join DataSets that should be used as keys. * @return An incomplete Join transformation. * Call {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(int...)} or * {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(KeySelector)} * to continue the Join. * * @see Tuple * @see DataSet */ public JoinOperatorSetsPredicateBase where(String... fields) { return new JoinOperatorSetsPredicateBase(new Keys.ExpressionKeys<>(fields, input1.getType())); }
/** * Continues a Join transformation. * * <p>Defines the fields of the first join {@link DataSet} that should be used as grouping keys. Fields * are the names of member fields of the underlying type of the data set. * * @param fields The fields of the first join DataSets that should be used as keys. * @return An incomplete Join transformation. * Call {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(int...)} or * {@link org.apache.flink.api.java.operators.join.JoinOperatorSetsBase.JoinOperatorSetsPredicateBase#equalTo(KeySelector)} * to continue the Join. * * @see Tuple * @see DataSet */ public JoinOperatorSetsPredicateBase where(String... fields) { return new JoinOperatorSetsPredicateBase(new Keys.ExpressionKeys<>(fields, input1.getType())); }
@Override public DataSet<WithCount<GradoopId>> execute(LogicalGraph graph) { return new EdgeValueDistribution<>(new SourceId<>()).execute(graph) .rightOuterJoin(graph.getVertices().map(new Id<>())) .where(0).equalTo("*") .with(new SetOrCreateWithCount()); }
@Override public DataSet<WithCount<GradoopId>> execute(LogicalGraph graph) { return new EdgeValueDistribution<>(new TargetId<>()).execute(graph) .rightOuterJoin(graph.getVertices().map(new Id<>())) .where(0).equalTo("*") .with(new SetOrCreateWithCount()); }
@Override public DataSet<WithCount<GradoopId>> execute(LogicalGraph graph) { return new EdgeValueDistribution<>(new SourceId<>()).execute(graph) .rightOuterJoin(graph.getVertices().map(new Id<>())) .where(0).equalTo("*") .with(new SetOrCreateWithCount()); } }
@Override public DataSet<WithCount<GradoopId>> execute(LogicalGraph graph) { return new EdgeValueDistribution<>(new TargetId<>()).execute(graph) .rightOuterJoin(graph.getVertices().map(new Id<>())) .where(0).equalTo("*") .with(new SetOrCreateWithCount()); } }
.fullOuterJoin(authority, JoinHint.REPARTITION_SORT_MERGE) .where(0) .equalTo(0) .with(new JoinAndNormalizeHubAndAuthority<>()) .withBroadcastSet(hubbinessSumSquared, HUBBINESS_SUM_SQUARED) .fullOuterJoin(scores, JoinHint.REPARTITION_SORT_MERGE) .where(0) .equalTo(0) .with(new ChangeInScores<>()) .setParallelism(parallelism)
.leftOuterJoin(highDegreeVertices, joinHint) .where(0) .equalTo(0) .with(new ProjectVertex<>()) .setParallelism(parallelism) .leftOuterJoin(highDegreeVertices, joinHint) .where(reduceOnTargetId.get() ? 1 : 0) .equalTo(0) .with(new ProjectEdge<>()) .setParallelism(parallelism) .leftOuterJoin(highDegreeVertices, joinHint) .where(reduceOnTargetId.get() ? 0 : 1) .equalTo(0) .with(new ProjectEdge<>()) .setParallelism(parallelism)