spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohit Anchlia <mohitanch...@gmail.com>
Subject Re: Compilation error on JavaPairDStream
Date Tue, 10 Mar 2015 22:04:47 GMT
works now. I should have checked :)

On Tue, Mar 10, 2015 at 1:44 PM, Sean Owen <sowen@cloudera.com> wrote:

> Ah, that's a typo in the example: use words.mapToPair
> I can make a little PR to fix that.
>
> On Tue, Mar 10, 2015 at 8:32 PM, Mohit Anchlia <mohitanchlia@gmail.com>
> wrote:
> > I am getting following error. When I look at the sources it seems to be a
> > scala source, but not sure why it's complaining about it.
> >
> > The method map(Function<String,R>) in the type JavaDStream<String> is
not
> > applicable for the arguments (new
> >
> > PairFunction<String,String,Integer>(){})
> >
> >
> > And my code has been taken from the spark examples site:
> >
> >
> > JavaPairDStream<String, Integer> pairs = words.map(
> >
> > new PairFunction<String, String, Integer>() {
> >
> > @Override public Tuple2<String, Integer> call(String s) throws Exception
> {
> >
> > return new Tuple2<String, Integer>(s, 1);
> >
> >
> > }
> >
> > });
> >
> >
>

Mime
View raw message