[
https://issues.apache.org/jira/browse/FLINK-3504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15171918#comment-15171918
]
ASF GitHub Bot commented on FLINK-3504:
---------------------------------------
GitHub user fhueske opened a pull request:
https://github.com/apache/flink/pull/1734
[FLINK-3504] Fix join translation. Equality predicates may only reference
fields
Adapts the join translation rule such that only joins with proper equality
join predicates are translated.
A proper equality join predicate does only references fields, i.e., it does
not reference expressions.
Joins without at least one proper equality join predicates or with an
equality join predicate which references an expression are not translated.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/fhueske/flink tableJoinFix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1734.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1734
----
commit 004f409a7d233f711a889229ec22600550637cfd
Author: Fabian Hueske <[email protected]>
Date: 2016-02-29T13:46:08Z
[FLINK-3504] Fix join translation. Equality predicates may only reference
fields.
----
> Join fails while have expression inside join condition.
> -------------------------------------------------------
>
> Key: FLINK-3504
> URL: https://issues.apache.org/jira/browse/FLINK-3504
> Project: Flink
> Issue Type: Bug
> Components: Table API
> Reporter: Chengxiang Li
> Assignee: Fabian Hueske
>
> {noformat}
> val ds1 = CollectionDataSets.get3TupleDataSet(env).as('a, 'b, 'c)
> val ds2 = CollectionDataSets.get5TupleDataSet(env).as('d, 'e, 'f, 'g, 'h)
> val joinT = ds1.join(ds2).filter('a + 3 === 'd).select('c, 'g)
> {noformat}
> This query would throw exception:
> {noformat}
> Caused by: org.apache.flink.api.table.TableException: Joins should have at
> least one equality condition
> at
> org.apache.flink.api.table.plan.rules.dataset.DataSetJoinRule.convert(DataSetJoinRule.scala:57)
> at
> org.apache.calcite.rel.convert.ConverterRule.onMatch(ConverterRule.java:116)
> at
> org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:228)
> ... 44 more
> {noformat}
> There are 2 issues here:
> # DataSetJoinRule does not support expression inside join condition.
> # JoinPushExpressionsRulewould add a Project to calculate expression value
> before Join, so the join condition does not include expression any more,
> however, it's not returned after the logical optimization.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)