Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3595

Wrong results returned by query that uses LEAD window function

    Details

      Description

      Query that uses LEAD window function returns wrong results on developer's private branch (new-window-funcs).

      Results returned by Drill

      0: jdbc:drill:schema=dfs.tmp> select lead(c1) over w from union_01 window w as (partition by c3 order by c1) limit 10;
      +---------+
      | EXPR$0  |
      +---------+
      | 878     |
      | -150    |
      | 402     |
      | 402     |
      | 402     |
      | 402     |
      | 402     |
      | 160     |
      | 160     |
      | 160     |
      +---------+
      10 rows selected (0.349 seconds)
      

      Results returned by Postgres

      postgres=# select lead(c1) over w from union_01 window w as (partition by c3 order by c1) limit 10;
       lead 
      ------
           
           
        402
        402
        402
        402
        402
           
        160
        160
      (10 rows)
      

        Attachments

        1. union_01.parquet
          2 kB
          Khurram Faraaz

          Activity

            People

            • Assignee:
              adeneche Deneche A. Hakim
              Reporter:
              khfaraaz Khurram Faraaz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: