beam-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Kirpichov <kirpic...@google.com>
Subject Re: CoGroupByKey question
Date Thu, 08 Feb 2018 18:17:00 GMT
You typically get this compile error when you have a raw type (e.g.
PCollection instead of PCollection<Something>) sneaking somewhere. Perhaps
tempPCollection or humPCollection is declared as a PCollection without a
type?

On Thu, Feb 8, 2018 at 2:53 AM Steiner Patrick <patrick@steiner-buchholz.de>
wrote:

> 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
>

Mime
View raw message