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

    https://github.com/apache/flink/pull/1981#discussion_r64762144
  
    --- 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 {
    +        case (x : JoinFieldReference) :: (y : JoinFieldReference) :: Nil  
=>
    +          x.belongsToLeft == y.belongsToLeft
    +        case _ => true
    +      }) {
    +        failValidation(s"Only join predicates supported. For non-join 
predicates use Table#where.")
    +      }
     
         var equiJoinFound = false
    -    def validateConditions(exp: Expression) : Unit = exp match {
    -      case x: And => x.children.foreach(validateConditions(_))
    +    def validateConditions(exp: Expression, isAndBranch: Boolean): Unit = 
exp match {
    --- End diff --
    
    I'm sorry but this check does not catch all cases. For example, it would 
let `l.a = r.b OR (l.c = r.d && l.e = r.f)` pass.


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