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

    https://github.com/apache/flink/pull/1981#discussion_r64742780
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/logical/operators.scala
 ---
    @@ -342,21 +368,29 @@ case class Join(
       }
     
       private def testJoinCondition(expression: Expression): Unit = {
    -    def checkIfJoinCondition(exp : Expression) = if 
(exp.children.exists(!_.isInstanceOf[JoinFieldReference])) {
    -      failValidation(s"Only join predicates supported. For non-join 
predicates use Table#where.")
    -    }
    +    def checkIfJoinCondition(exp : BinaryComparison) =
    +      if (exp.children match {
    --- End diff --
    
    The condition looks good but can be a bit simplified like this:
    ```
    exp.children match {
      case (x: JoinFieldReference) :: (y: JoinFieldReference) :: Nil
        if x.isFromLeftInput != y.isFromLeftInput
          => // predicate references both inputs. All good!
      case _ => failValidation(
        s"Only join predicates supported. For non-join predicates use 
Table#where.")
    }
    ```


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