Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3673#discussion_r113497136
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/dataSet/DataSetSingleRowJoinRule.scala
 ---
    @@ -37,10 +37,10 @@ class DataSetSingleRowJoinRule
       override def matches(call: RelOptRuleCall): Boolean = {
         val join = call.rel(0).asInstanceOf[FlinkLogicalJoin]
     
    -    if (isInnerJoin(join)) {
    -      isSingleRow(join.getRight) || isSingleRow(join.getLeft)
    -    } else {
    -      false
    +    join.getJoinType match {
    +      case JoinRelType.INNER | JoinRelType.LEFT | JoinRelType.RIGHT =>
    --- End diff --
    
    We can only support this for outer joins if the single-row input is on the 
inner side of the join. 
    If the single row is on the outer side, we would need check that it does 
not join with any of the inner side before we send out a result with `null` 
fields. Since the single row is broadcasted / replicated, it is not possible to 
check this.
    
    Hence, the condition should be:
    ```
      case JoinRelType.INNER if isSingleRow(join.getLeft) || 
isSingleRow(join.getRight) => true
      case JoinRelType.LEFT if isSingleRow(join.getRight) => true
      case JoinRelType.RIGHT if isSingleRow(join.getLeft) => true
      case _ => false
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to