Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-10493

Using JOIN ON syntax to join two full ACID collections produces wrong results

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • ghx-label-4

    Description

      The following query produces wrong results:

      use functional_orc_def; // use full ACID tables
      select a1.item, a2.item
      from complextypestbl.int_array a1 join complextypestbl.int_array a2
      on a1.item=a2.item
      where a1.item<2;

      It creates a CROSS JOIN without the predicate "a1.item = a2.item", generating too many rows. The expected plan node would be an INNER JOIN on "a1.item = a2.item".

      If we put the JOIN condition to the WHERE clause we get the correct plan:

      select a1.item, a2.item
      from complextypestbl.int_array a1 join complextypestbl.int_array a2
      where a1.item=a2.item and a1.item<2

      We also get a correct plan if the right table is non-ACID:

      select a1.item, a2.item
      from complextypestbl.int_array a1 join functional_parquet.complextypestbl.int_array a2
      on a1.item=a2.item
      where a1.item<2;

      Or ACID table but the column is non-collection:

      select c.id, a1.item
      from complextypestbl.int_array a1 join complextypestbl c
      on c.id=a1.item
      where c.id<2;

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            boroknagyz Zoltán Borók-Nagy
            boroknagyz Zoltán Borók-Nagy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment