You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "ZHANG ZHIPENG (Jira)" <ji...@apache.org> on 2021/09/14 10:27:00 UTC

[jira] [Created] (FLINK-24279) Support withBroadcast in DataStream API

ZHANG ZHIPENG created FLINK-24279:
-------------------------------------

             Summary: Support withBroadcast in DataStream API
                 Key: FLINK-24279
                 URL: https://issues.apache.org/jira/browse/FLINK-24279
             Project: Flink
          Issue Type: New Feature
          Components: Library / Machine Learning
            Reporter: ZHANG ZHIPENG


When doing machine learning using DataStream API, we found that DataStream lacks withBroadcast() function, which could be useful in machine learning.

 

A DataSet-based demo is like:

 

DataSet<?> d1 = ...;

DataSet<?> d2 = ...;

d1.map(new RichMapFunction <?, ?>() {
      @Override
      public Object map(Object aLong) throws Exception {
           List<?> elements = getRuntimeContext().getBroadcastVariable("d1");

           ...
      }
}).withBroadcastSet(d2, "d2")

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)