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

    https://github.com/apache/flink/pull/1981#discussion_r64709704
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/logical/operators.scala
 ---
    @@ -298,11 +333,34 @@ case class Join(
         val resolvedJoin = super.validate(tableEnv).asInstanceOf[Join]
         if (!resolvedJoin.condition.forall(_.resultType == BOOLEAN_TYPE_INFO)) 
{
           failValidation(s"filter expression ${resolvedJoin.condition} is not 
a boolean")
    -    } else if (!ambiguousName.isEmpty) {
    +    } else if (ambiguousName.nonEmpty) {
           failValidation(s"join relations with ambiguous names: 
${ambiguousName.mkString(", ")}")
         }
    +
    +    resolvedJoin.condition.foreach(testJoinCondition(_))
         resolvedJoin
       }
    +
    +  private def testJoinCondition(expression: Expression): Unit = {
    +    def checkIfJoinCondition(exp : Expression) = if 
(exp.children.exists(!_.isInstanceOf[JoinFieldReference])) {
    --- End diff --
    
    The condition here should be: all (of the two) children are 
`JoinFieldReference` and one is on left and the other on the right input 
(that's where the input flag in `JoinFieldReference` is helpful).
    
    I would also change the type of `exp` to `BinaryComparison`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to