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

[jira] [Created] (IGNITE-13961) Hierarchical table join causes "Failed to generate REDUCE query. Data table found"

Ilya Kasnacheev created IGNITE-13961:
----------------------------------------

             Summary: Hierarchical table join causes "Failed to generate REDUCE query. Data table found"
                 Key: IGNITE-13961
                 URL: https://issues.apache.org/jira/browse/IGNITE-13961
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.9.1, 2.8.1
            Reporter: Ilya Kasnacheev


{code}
create table tasks (id int primary key, parent_id int);
insert into tasks (id, parent_id) values (1, 1);
insert into tasks (id, parent_id) values (2, 1);
insert into tasks (id, parent_id) values (5, 3);
insert into tasks (id, parent_id) values (7, null);
SELECT * FROM (SELECT DISTINCT id, parent_id FROM tasks) AS orphan WHERE orphan.parent_id NOT IN (SELECT id FROM tasks) or orphan.parent_id is null;
{code}
Expected: (5, 3), (7, null)

Actual:
{code}
Error: Failed to generate REDUCE query. Data table found: PUBLIC.TASKS 
SELECT
ORPHAN__Z1.ID,
ORPHAN__Z1.PARENT_ID
FROM (SELECT DISTINCT
__C0_0 ID,
__C0_1 PARENT_ID
FROM PUBLIC.__T0) ORPHAN__Z1
WHERE (ORPHAN__Z1.PARENT_ID IS NULL) OR (NOT (ORPHAN__Z1.PARENT_ID IN( SELECT
__Z2.ID
FROM PUBLIC.TASKS __Z2 ))) (state=50000,code=1)
{code}



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