protected void crossMatchingGroup(Iterator<T1> values1, Iterator<T2> values2, FlatJoinFunction<T1, T2, O> joinFunction, Collector<O> collector) throws Exception { final T1 firstV1 = values1.next(); final T2 firstV2 = values2.next(); final boolean v1HasNext = values1.hasNext(); final boolean v2HasNext = values2.hasNext(); // check if one side is already empty // this check could be omitted if we put this in MatchTask. // then we can derive the local strategy (with build side). if (v1HasNext) { if (v2HasNext) { // both sides contain more than one value // TODO: Decide which side to spill and which to block! crossMwithNValues(firstV1, values1, firstV2, values2, joinFunction, collector); } else { crossSecond1withNValues(firstV2, firstV1, values1, joinFunction, collector); } } else { if (v2HasNext) { crossFirst1withNValues(firstV1, firstV2, values2, joinFunction, collector); } else { // both sides contain only one value joinFunction.join(firstV1, firstV2, collector); } } }
protected void crossMatchingGroup(Iterator<T1> values1, Iterator<T2> values2, FlatJoinFunction<T1, T2, O> joinFunction, Collector<O> collector) throws Exception { final T1 firstV1 = values1.next(); final T2 firstV2 = values2.next(); final boolean v1HasNext = values1.hasNext(); final boolean v2HasNext = values2.hasNext(); // check if one side is already empty // this check could be omitted if we put this in MatchTask. // then we can derive the local strategy (with build side). if (v1HasNext) { if (v2HasNext) { // both sides contain more than one value // TODO: Decide which side to spill and which to block! crossMwithNValues(firstV1, values1, firstV2, values2, joinFunction, collector); } else { crossSecond1withNValues(firstV2, firstV1, values1, joinFunction, collector); } } else { if (v2HasNext) { crossFirst1withNValues(firstV1, firstV2, values2, joinFunction, collector); } else { // both sides contain only one value joinFunction.join(firstV1, firstV2, collector); } } }
protected void crossMatchingGroup(Iterator<T1> values1, Iterator<T2> values2, FlatJoinFunction<T1, T2, O> joinFunction, Collector<O> collector) throws Exception { final T1 firstV1 = values1.next(); final T2 firstV2 = values2.next(); final boolean v1HasNext = values1.hasNext(); final boolean v2HasNext = values2.hasNext(); // check if one side is already empty // this check could be omitted if we put this in MatchTask. // then we can derive the local strategy (with build side). if (v1HasNext) { if (v2HasNext) { // both sides contain more than one value // TODO: Decide which side to spill and which to block! crossMwithNValues(firstV1, values1, firstV2, values2, joinFunction, collector); } else { crossSecond1withNValues(firstV2, firstV1, values1, joinFunction, collector); } } else { if (v2HasNext) { crossFirst1withNValues(firstV1, firstV2, values2, joinFunction, collector); } else { // both sides contain only one value joinFunction.join(firstV1, firstV2, collector); } } }
protected void crossMatchingGroup(Iterator<T1> values1, Iterator<T2> values2, FlatJoinFunction<T1, T2, O> joinFunction, Collector<O> collector) throws Exception { final T1 firstV1 = values1.next(); final T2 firstV2 = values2.next(); final boolean v1HasNext = values1.hasNext(); final boolean v2HasNext = values2.hasNext(); // check if one side is already empty // this check could be omitted if we put this in MatchTask. // then we can derive the local strategy (with build side). if (v1HasNext) { if (v2HasNext) { // both sides contain more than one value // TODO: Decide which side to spill and which to block! crossMwithNValues(firstV1, values1, firstV2, values2, joinFunction, collector); } else { crossSecond1withNValues(firstV2, firstV1, values1, joinFunction, collector); } } else { if (v2HasNext) { crossFirst1withNValues(firstV1, firstV2, values2, joinFunction, collector); } else { // both sides contain only one value joinFunction.join(firstV1, firstV2, collector); } } }