Hi Greg,
I use something similar to this in my application but not for empty string.
So the below example is not tested but it should work.

JavaRDD<String> filteredJavaRDD = example.filter(new
Function<String,Boolean>(){
public Boolean call(String arg0) throws Exception {
return (!arg0.equals(""));
}
});

Thanks!
Nirmal
On Thu, Apr 7, 2016 at 8:27 AM Chris Miller <cmiller11...@gmail.com> wrote:

> flatmap?
>
>
> --
> Chris Miller
>
> On Thu, Apr 7, 2016 at 10:25 PM, greg huang <debin.hu...@gmail.com> wrote:
>
>> Hi All,
>>
>>    Can someone give me a example code to get rid of the empty string in
>> JavaRDD<String>? I kwon there is a filter method in JavaRDD<T>:
>> https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/rdd/RDD.html#filter(scala.Function1)
>>
>> Regards,
>>    Greg
>>
>
>

Reply via email to