You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Haisheng Yuan (Jira)" <ji...@apache.org> on 2020/06/08 23:42:00 UTC
[jira] [Resolved] (CALCITE-4050) Traits Propagation for
EnumerableMergeJoin Produces Incorrect Result
[ https://issues.apache.org/jira/browse/CALCITE-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Haisheng Yuan resolved CALCITE-4050.
------------------------------------
Fix Version/s: 1.24.0
Resolution: Fixed
Fixed in [https://github.com/apache/calcite/commit/dcc76cede53c7971bc9c3755d9261e766aa63b66].
> Traits Propagation for EnumerableMergeJoin Produces Incorrect Result
> --------------------------------------------------------------------
>
> Key: CALCITE-4050
> URL: https://issues.apache.org/jira/browse/CALCITE-4050
> Project: Calcite
> Issue Type: Bug
> Reporter: Jinpeng Wu
> Priority: Major
> Fix For: 1.24.0
>
>
> In EnumerableMergeJoin's deriveTraits method, it uses a Map to record mapping from left keys to right keys (the keyMap variable). However, the left keys could have duplicate entries.
> One example is JdbcTest.testJoinInCorrelatedSubQuery, the expected plan is
> EnumerableProject(deptno=[$0], name=[$1], employees=[$2], location=[$3])
> EnumerableMergeJoin(condition=[AND(=($0, $5), =($0, $4))], joinType=[inner])
> EnumerableSort(sort0=[$0], dir0=[ASC])
> EnumerableTableScan(table=[[hr, depts]])
> EnumerableSort(sort0=[$1], sort1=[$0], dir0=[ASC], dir1=[ASC])
> ...
> where left keys are [0, 0] , and right keys are [1, 0]. Deriving right child's traits may result in incorrect output.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)