aljoscha commented on a change in pull request #14312:
URL: https://github.com/apache/flink/pull/14312#discussion_r551346465



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/BroadcastConnectedStream.java
##########
@@ -246,28 +246,36 @@ public StreamExecutionEnvironment 
getExecutionEnvironment() {
         return returnStream;
     }
 
-    private <OUT> BroadcastStateTransformation<IN1, IN2, OUT> 
getBroadcastStateTransformation(
+    @Internal
+    private <KEY, OUT> SingleOutputStreamOperator<OUT> transform(
             final String functionName,
-            final TypeInformation<OUT> outTypeInfo,
-            final TwoInputStreamOperator<IN1, IN2, OUT> operator) {
-
-        if (nonBroadcastStream instanceof KeyedStream) {
-            return BroadcastStateTransformation.forKeyedStream(
-                    functionName,
-                    (KeyedStream<IN1, ?>) nonBroadcastStream,
-                    broadcastStream,
-                    SimpleOperatorFactory.of(operator),
-                    outTypeInfo,
-                    environment.getParallelism());
-        } else {
-            return BroadcastStateTransformation.forNonKeyedStream(
-                    functionName,
-                    nonBroadcastStream,
-                    broadcastStream,
-                    SimpleOperatorFactory.of(operator),
-                    outTypeInfo,
-                    environment.getParallelism());
-        }
+            final KeyedBroadcastProcessFunction<KEY, IN1, IN2, OUT> 
userFunction,
+            final TypeInformation<OUT> outTypeInfo) {
+
+        // read the output type of the input Transforms to coax out errors 
about MissingTypeInfo
+        nonBroadcastStream.getType();
+        broadcastStream.getType();
+
+        KeyedStream<IN1, KEY> keyedInputStream = (KeyedStream<IN1, KEY>) 
nonBroadcastStream;
+
+        final KeyedBroadcastStateTransformation<KEY, IN1, IN2, OUT> 
transformation =
+                new KeyedBroadcastStateTransformation<>(
+                        functionName,

Review comment:
       fixing




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to