flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Baghino <stefano.bagh...@radicalbit.io>
Subject Re: filter dataset
Date Mon, 29 Feb 2016 12:11:23 GMT
Hi Lydia,

you can use a variable outside the scope of the normal filter (the one that
you define inline, if I understand correctly), like this:

*final* int *filterParameter* = 0;

dataset.filter(new FilterFunction<Integer, Integer, Double> () {
    public boolean filter(Integer value) {
        return value == *filterParameter*;

The only catch is that you have to make the variable *final*.

Does this answer your question? Hope I've been helpful.


On Mon, Feb 29, 2016 at 11:14 AM, Lydia Ickler <icklerly@googlemail.com>

> Hi all,
> I have a DataSet<Tuple3<Integer, Integer, Double> and I want to apply a
> filter to only get back all entries with e.g. first Integer in tuple == 0.
> With a normal filter I do not have the possibility to pass an an
> additional argument but I have to set that parameter inside the filter
> function.
> Is there a possibility to send a parameter to make the filter more
> flexible?
> How would be the smartest way to do so?
> Best regards,
> Lydia

Stefano Baghino

Software Engineer @ Radicalbit

View raw message