Hi all,

I'm trying to combine two PCollections<KV<String, Double>> via CoGroupByKey

When adapting the sample code

final TupleTag<V1> t1 = new TupleTag<>();
final TupleTag<V2> t2 = new TupleTag<>();

PCollection<KV<K, CoGbkResult>> coGbkResultCollection =
        KeyedPCollectionTuple.of(t1, pt1)
        .and(t2, pt2)
        .apply(CoGroupByKey.<K>create());

I do get

final TupleTag<Double> tempTuple = new TupleTag<>();
final TupleTag<Double> humTuple = new TupleTag<>();

PCollection<KV<String, CoGbkResult>> coGbkResultCollection =
        KeyedPCollectionTuple.of(tempTuple, tempPCollection)
        .and(humTuple, humPCollection)
        .apply(CoGroupByKey.<String>create());

which results in

Type mismatch: cannot convert from POutput to PCollection<KV<String,CoGbkResult>>

I guess it's a simple, stupid thing I'm either missing or not understanding, when combining my two PCollections to one.

Any advice is appreciated

Patrick

Reply via email to