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

row_number function returns incorrect result when only order by clause is specified

    XMLWordPrintableJSON

Details

    Description

      Queries returning wrong result:

      select c_integer, row_number() over(order by c_integer) from j1 order by 2;
      select c_integer, row_number() over(order by c_integer) from j1 order by 2 desc;
      select c_integer, row_number() over(order by c_integer desc) from j1 order by 2;
      select c_integer, row_number() over(order by c_integer desc) from j1 order by 2;
      select c_integer, row_number() over(order by c_integer nulls first) from j1 order by c_integer nulls last,  row_number() over(order by c_integer nulls first);
      select c_integer, row_number() over(order by c_integer nulls last) from j1 order by c_integer nulls first, row_number() over(order by c_integer nulls last);
      

      In attached tar file (row_number_wrong_result.tar) you will find:

      1. *.sql - file that contains query
      2. *.res - expected result (generated from Postgres)
      3. *.out - result returned by drill

      Attachments

        1. row_number_wrong_result.tar
          1.76 MB
          Victoria Markman
        2. j1.tar
          1.04 MB
          Victoria Markman
        3. 0001-DRILL-3327-If-no-partition-by-is-specified-read-all-.patch
          2 kB
          Aman Sinha

        Issue Links

          Activity

            People

              vicky Victoria Markman
              vicky Victoria Markman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: