DB connection and query inside map function

Posted by Anastasios Skarlatidis on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/DB-connection-and-query-inside-map-function-tp10342.html

Hi! 

I am new to Apache Flink and I would like to ask what is the best way to query a relational DB inside a map function, in order to enrich the streaming data. Consider, for example, that I have a KeyedStream[Int, String] and I would like to query the database based on the Int value inside a map function `stream.map(v: Int => <<some SQL query>> )`. 

Is it possible to have a connection pooler per worker nod,e in order to be used inside each map function call?

Best,

Anastasios