Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/1981#discussion_r64778778 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/logical/operators.scala --- @@ -298,11 +338,40 @@ 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 : BinaryComparison) = exp.children match { + case (x : JoinFieldReference) :: (y : JoinFieldReference) :: Nil + if x.isFromLeftInput != y.isFromLeftInput => Unit + case _ => failValidation( + s"Only join predicates supported. For non-join predicates use Table#where.") --- End diff -- Add the condition that causes the failure to the error message.
--- 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. ---