flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request #3673: [FLINK-5256] Extend DataSetSingleRowJoin to suppor...
Date Thu, 27 Apr 2017 10:49:53 GMT
Github user fhueske commented on a diff in the pull request:

    --- 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) =>
      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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message