Hello everyone,

I need to parse into an anonymous function an input data to turn it into
several Row elements. Originally I would have done something like
Row.of(1,2,3,4) but these elements can change on the flight as part of my
function. This is why I have decided to store them in a list and right now
it looks something like this:

[image: image.png]

Now, I need to return my out Collector it Row<> based on this elements. I
checked on the Flink documentation but the Lambda functions are not
supported :
https://ci.apache.org/projects/flink/flink-docs-stable/dev/java_lambdas.html ,
Then I though ok I can loop my ArrayList in a Tuple and pass this tuple as
Row.of(myTuple):

                    Tuple mytuple = Tuple.newInstance(5);
                    for (int i = 0; i < pelements.size(); i++) {
                        mytuple.setField(pelements.get(i), i);
                    }
                    out.collect(Row.of(mytuple));


However , it doesnt work because this is being parsed s 1 element for
sqlQuery step. how could I do something like:

pelements.forEach(n->out.collect(Row.of(n)));

Thanks so much

Reply via email to