You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by dinizthiagobr <di...@gmail.com> on 2015/09/15 19:11:28 UTC

mappartition's FlatMapFunction help

Can't get this one to work and I have no idea why.

JavaPairRDD<String, Iterable&lt;String>> lel = gen.groupByKey();

JavaRDD<String> partitions = lel.mapPartitions(
new FlatMapFunction<Iterator&lt;Tuple2&lt;String, Iterable&lt;String>>>,
String> () {
      public Iterable<String> call(Iterator<Tuple2&lt;String,
Iterable&lt;String>>> it) {
           //return whatever
       }
});

Netbeans complains about mapPartitions not being applicable for the used
arguments.

Any idea what's wrong?

Thank you.



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/mappartition-s-FlatMapFunction-help-tp24702.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Re: mappartition's FlatMapFunction help

Posted by Ankur Srivastava <an...@gmail.com>.
Good to know it worked for you.

CC'ed user group so that the thread reaches a closure.

Thanks
Ankur

On Wed, Sep 16, 2015 at 6:13 AM, Thiago Diniz <di...@gmail.com>
wrote:

> Nailed it.
>
> Thank you!
>
> 2015-09-15 14:39 GMT-03:00 Ankur Srivastava <an...@gmail.com>:
>
>> Hi,
>>
>> The signatures are perfect. I also tried same code on eclipse and for
>> some reason eclipse did not import java.util.Iterator. Once I imported it,
>> it is fine. Might be same issue with NetBeans.
>>
>> Thanks
>> Ankur
>>
>> On Tue, Sep 15, 2015 at 10:11 AM, dinizthiagobr <di...@gmail.com>
>> wrote:
>>
>>> Can't get this one to work and I have no idea why.
>>>
>>> JavaPairRDD<String, Iterable&lt;String>> lel = gen.groupByKey();
>>>
>>> JavaRDD<String> partitions = lel.mapPartitions(
>>> new FlatMapFunction<Iterator&lt;Tuple2&lt;String, Iterable&lt;String>>>,
>>> String> () {
>>>       public Iterable<String> call(Iterator<Tuple2&lt;String,
>>> Iterable&lt;String>>> it) {
>>>            //return whatever
>>>        }
>>> });
>>>
>>> Netbeans complains about mapPartitions not being applicable for the used
>>> arguments.
>>>
>>> Any idea what's wrong?
>>>
>>> Thank you.
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-spark-user-list.1001560.n3.nabble.com/mappartition-s-FlatMapFunction-help-tp24702.html
>>> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
>>> For additional commands, e-mail: user-help@spark.apache.org
>>>
>>>
>>
>

Re: mappartition's FlatMapFunction help

Posted by Ankur Srivastava <an...@gmail.com>.
Hi,

The signatures are perfect. I also tried same code on eclipse and for some
reason eclipse did not import java.util.Iterator. Once I imported it, it is
fine. Might be same issue with NetBeans.

Thanks
Ankur

On Tue, Sep 15, 2015 at 10:11 AM, dinizthiagobr <di...@gmail.com>
wrote:

> Can't get this one to work and I have no idea why.
>
> JavaPairRDD<String, Iterable&lt;String>> lel = gen.groupByKey();
>
> JavaRDD<String> partitions = lel.mapPartitions(
> new FlatMapFunction<Iterator&lt;Tuple2&lt;String, Iterable&lt;String>>>,
> String> () {
>       public Iterable<String> call(Iterator<Tuple2&lt;String,
> Iterable&lt;String>>> it) {
>            //return whatever
>        }
> });
>
> Netbeans complains about mapPartitions not being applicable for the used
> arguments.
>
> Any idea what's wrong?
>
> Thank you.
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/mappartition-s-FlatMapFunction-help-tp24702.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>
>