You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Lukas Eder (Jira)" <ji...@apache.org> on 2021/01/23 09:51:00 UTC

[jira] [Created] (IGNITE-14040) NATURAL JOIN not implemented correctly

Lukas Eder created IGNITE-14040:
-----------------------------------

             Summary: NATURAL JOIN not implemented correctly
                 Key: IGNITE-14040
                 URL: https://issues.apache.org/jira/browse/IGNITE-14040
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.9.1
            Reporter: Lukas Eder


Try this:

 
{code:java}
CREATE TABLE t1 (i int PRIMARY KEY, j int);
CREATE TABLE t2 (i int PRIMARY KEY, k int);
INSERT INTO t1 VALUES (1, 1), (2, 2);
INSERT INTO t2 VALUES (2, 2), (3, 3);
SELECT * FROM t1 NATURAL JOIN t2;
{code}
 

It doesn't yield any results, when we should be getting:
{noformat}
|I |J |K |
|--|--|--|
|2 |2 |2 |{noformat}
The explain plan on the SELECT seems to hint at keys and values being compared
{code:java}
SELECT
 __Z0.I AS __C0_0,
 __Z0.J AS __C0_1,
 __Z1.K AS __C0_2
FROM PUBLIC.T1 __Z0
 /* PUBLIC.T1.__SCAN_ */
INNER JOIN PUBLIC.T2 __Z1
 /* PUBLIC."_key_PK": _KEY = PUBLIC.__Z0._KEY */
 ON 1=1
WHERE (PUBLIC.__Z0.I = PUBLIC.__Z1.I)
 AND ((PUBLIC.__Z0._KEY = PUBLIC.__Z1._KEY)
 AND (PUBLIC.__Z0._VAL = PUBLIC.__Z1._VAL)){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)