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

Combining fragments with compatible data partitions can lead to incorrect results due to type incompatibilities (missing casts).

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 1.3.1, Impala 1.4
    • Impala 2.0
    • None

    Description

      The following query returns incorrect results but the the equivalent [broadcast] version returns correct results.
      The reason is that we hoist up the compatible agg child fragment into the partitioned join fragment, but the hoisted-up agg fragment has an exchange that hashes on "c" as a int type. Even though the "c" columns are value equivalent their hashes are only equal if hashed as the same type.
      One way to fix this could be to add a cast to the data exchange of the agg fragment.

      create table foo (c int);
      insert into foo values(1),(2),(3),(4),(5),(6);
      
      create table bar (c bigint);
      insert into bar values(1),(2),(3),(4),(5),(6);
      
      select f.c, b.c from
        (select c from foo union select c from foo) f
      inner join [shuffle]
        (select c from bar union select c from bar) b
      on f.c = b.c
      

      Attachments

        Activity

          People

            alex.behm Alexander Behm
            alex.behm Alexander Behm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: