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

Wrong results when query has an outer join, inline views and null-generating functions like coalesce

    XMLWordPrintableJSON

Details

    Description

      Steps to reproduce:

      create table tt1 (a int, b int);
      insert into tt1 values ((1,1), (2,2));
      create table tt2 (a int, b int);
      insert into tt2 values ((1,1), (2,2));
      create function identity(int) returns int location '/test-warehouse/libTestUdfs.so' symbol='Identity';
      

      The following query returns nulls in the columns of the outer joined table.

      select * from tt1 left outer join (select coalesce(identity(a), 1) as b from tt2) tt3 on tt1.a = tt3.b;
      

      The issue also appears when no UDFs are used in the coalesce expression, as follows:

      select * from tt1 left outer join (select coalesce(a, 1) as b from tt2) tt3 on tt1.a = tt3.b;
      

      Attachments

        Activity

          People

            dtsirogiannis Dimitris Tsirogiannis
            dtsirogiannis Dimitris Tsirogiannis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: