You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by XiangWei Huang <xw...@gmail.com> on 2018/01/15 10:11:29 UTC

How to Join a dimension table in flink sql

Hi all,
   Is it possible to  join records read from a kafka stream with one(or
more) dimension tables which are saved as mysql table using flink streaming
sql.

Re: How to Join a dimension table in flink sql

Posted by Lin Li <li...@gmail.com>.
Hi XiangWei,
Currently one could implement a udtf to achieve that. (see
https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/table/udfs.
html#table-functions)
BTW, this udtf should carefully dealing with the connections to database
server(s),  and enable caching if possible can reduce server's pressure.

2018-01-15 18:11 GMT+08:00 XiangWei Huang <xw...@gmail.com>:

> Hi all,
>    Is it possible to  join records read from a kafka stream with one(or
> more) dimension tables which are saved as mysql table using flink streaming
> sql.
>

Re: How to Join a dimension table in flink sql

Posted by Xingcan <xi...@gmail.com>.
Hi XiangWei,

Unfortunately, it's not possible for the Flink SQL API to join a stream 
with a common dataset now. As a workaround, if the table is just a tiny 
one, you can achieve a inner/left outer join with the user defined table 
functions 
<https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/table/sql.html#joins>. 
Note that due to some reasons, the UDTF left outer join cannot support 
arbitrary conditions now.

Hope that helps.

Best,

Xingcan

On 15/01/2018 6:11 PM, XiangWei Huang wrote:
> Hi all,
> Is it possible to  join records read from a kafka stream with one(or 
> more) dimension tableswhich are saved as mysql table using flink 
> streaming sql.


Re: How to Join a dimension table in flink sql

Posted by Xingcan <xi...@gmail.com>.
Hi XiangWei,

Unfortunately, it's not possible for the Flink SQL API to join a stream 
with a common dataset now. As a workaround, if the table is just a tiny 
one, you can achieve a inner/left outer join with the user defined table 
functions 
<https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/table/sql.html#joins>. 
Note that due to some reasons, the UDTF left outer join cannot support 
arbitrary conditions now.

Hope that helps.

Best,

Xingcan

On 15/01/2018 6:11 PM, XiangWei Huang wrote:
> Hi all,
> Is it possible to  join records read from a kafka stream with one(or 
> more) dimension tableswhich are saved as mysql table using flink 
> streaming sql.