wuchong commented on a change in pull request #8629: 
[FLINK-12088][table-runtime-blink] Introduce unbounded streaming 
inner/left/right/full join operator
URL: https://github.com/apache/flink/pull/8629#discussion_r292288623
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/stream/StreamExecJoin.scala
 ##########
 @@ -123,7 +137,109 @@ class StreamExecJoin(
 
   override protected def translateToPlanInternal(
       tableEnv: StreamTableEnvironment): StreamTransformation[BaseRow] = {
-    throw new TableException("Implements this")
+
+    val tableConfig = tableEnv.getConfig
+    val returnType = FlinkTypeFactory.toInternalRowType(getRowType).toTypeInfo
+
+    val leftTransform = getInputNodes.get(0).translateToPlan(tableEnv)
+      .asInstanceOf[StreamTransformation[BaseRow]]
+    val rightTransform = getInputNodes.get(1).translateToPlan(tableEnv)
+      .asInstanceOf[StreamTransformation[BaseRow]]
+
+    val leftType = leftTransform.getOutputType.asInstanceOf[BaseRowTypeInfo]
+    val rightType = rightTransform.getOutputType.asInstanceOf[BaseRowTypeInfo]
+
+    val (leftJoinKey, rightJoinKey) =
+      JoinUtil.checkAndGetJoinKeys(keyPairs, getLeft, getRight, allowEmptyKey 
= true)
+
+    val leftSelect = KeySelectorUtil.getBaseRowSelector(leftJoinKey, leftType)
+    val rightSelect = KeySelectorUtil.getBaseRowSelector(rightJoinKey, 
rightType)
+
+    val leftInputSpec = analyzeJoinInput(left)
+    val rightInputSpec = analyzeJoinInput(right)
+
+    val generatedCondition = JoinUtil.generateConditionFunction(
+      tableConfig,
+      cluster.getRexBuilder,
+      getJoinInfo,
+      TypeConverters.createInternalTypeFromTypeInfo(leftType),
+      TypeConverters.createInternalTypeFromTypeInfo(rightType))
+
+    if (joinType == JoinRelType.ANTI || joinType == JoinRelType.SEMI) {
+      throw new TableException("SEMI/ANTI Join is not supported yet.")
+    }
+
+    val leftIsOuter = joinType == JoinRelType.LEFT || joinType == 
JoinRelType.FULL
+    val rightIsOuter = joinType == JoinRelType.RIGHT || joinType == 
JoinRelType.FULL
+    val minRetentionTime = tableConfig.getMinIdleStateRetentionTime
+
+    val operator = new StreamingJoinOperator(
+      leftType,
+      rightType,
+      generatedCondition,
+      leftInputSpec,
+      rightInputSpec,
+      leftIsOuter,
+      rightIsOuter,
+      filterNulls,
+      minRetentionTime)
+
+    val ret = new TwoInputTransformation[BaseRow, BaseRow, BaseRow](
+      leftTransform,
+      rightTransform,
+      "Join",
 
 Review comment:
   We can eliminate that information when used as transformation name. However, 
I can enrich the join operator name and refactor the operator names in a 
following PR.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to