Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13961

Hierarchical table join causes "Failed to generate REDUCE query. Data table found"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8.1, 2.9.1
    • None
    • sql
    • None
    • Release Notes Required

    Description

      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;
      

      Expected: (5, 3), (7, null)

      Actual:

      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)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ilyak Ilya Kasnacheev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: