Github user dawidwys commented on a diff in the pull request:
https://github.com/apache/flink/pull/1981#discussion_r64763844
--- 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 --
You're absolutely right, my mistake, sorry! I fixed it.
---
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.
---