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

Query generator creates non-deterministic analytic queries

    XMLWordPrintableJSON

Details

    Description

      Impala Query:

      SELECT
      LAG('644', 66) OVER (ORDER BY string_col ASC, tinyint_col) AS char_col,
      LAG(COALESCE(306, -86, -391), 77) OVER (ORDER BY month ASC, smallint_col DESC) AS int_col
      FROM alltypesagg
      order by char_col desc, int_col desc
      limit 15;
      

      Equivalent Postgres Query:

      SELECT
      LAG('644' || '', 66) OVER (ORDER BY CAST(string_col AS BYTEA) ASC, tinyint_col) AS char_col,
      LAG(COALESCE(306, -86, -391), 77) OVER (ORDER BY month ASC, smallint_col DESC) AS int_col
      FROM alltypesagg
      order by char_col desc, int_col desc
      limit 15;
      

      Impala Result:

      +----------+---------+
      | char_col | int_col |
      +----------+---------+
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | NULL    |
      | NULL     | 306     |
      | NULL     | 306     |
      +----------+---------+
      Fetched 15 row(s) in 0.84s
      

      Postgres Result:

       char_col | int_col 
      ----------+---------
                |        
                |        
                |        
                |        
                |        
                |        
                |        
                |        
                |        
                |        
                |        
                |        
                |     306
                |     306
                |     306
      (15 rows)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            tarasbob Taras Bobrovytsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: