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

queries with empty OVER() clause return empty result set

    XMLWordPrintableJSON

Details

    Description

      The following query returns, incorrectly, an empty result set:

      0: jdbc:drill:zk=local> SELECT employee_id, position_id, salary, SUM(salary) OVER() FROM cp.`employee.json` LIMIT 1000;
      +--------------+--------------+---------+---------+
      | employee_id  | position_id  | salary  | EXPR$3  |
      +--------------+--------------+---------+---------+
      +--------------+--------------+---------+---------+
      No rows selected (0.287 seconds)
      

      DRILL-1862 is required otherwise such queries won't plan at all.

      The problem is caused by WindowFrameRecordBatch.buildSchema() which assumes the very first batch to be an empty batch that only contains the schema, which is not the case when using OVER()

      Attachments

        1. DRILL-3268.1.patch.txt
          99 kB
          Abdel Hakim Deneche

        Activity

          People

            sphillips Steven Phillips
            adeneche Abdel Hakim Deneche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: