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

Drill should throw and error when window function defined using WINDOW AS uses ROWS UNBOUNDED PRECEDING

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      as part of DRILL-3188, the following query is not supported and Drill displays the proper error message:

      0: jdbc:drill:zk=local> select sum(salary) over(partition by position_id order by salary rows unbounded preceding) from cp.`employee.json` limit 20;
      Error: UNSUPPORTED_OPERATION ERROR: This type of window frame is currently not supported 
      See Apache Drill JIRA: DRILL-3188
      

      But when defining the same window using a WINDOW AS, Drill doesn't throw any error:

      0: jdbc:drill:zk=local> select sum(salary) over w from cp.`employee.json` window w as (partition by position_id order by salary rows unbounded preceding) limit 20;
      +-----------+
      |  EXPR$0   |
      +-----------+
      | 80000.0   |
      | 30000.0   |
      | 135000.0  |
      | 135000.0  |
      | 135000.0  |
      | 215000.0  |
      | 215000.0  |
      | 25000.0   |
      | 15000.0   |
      | 50000.0   |
      | 6700.0    |
      | 14700.0   |
      | 34700.0   |
      | 34700.0   |
      | 5000.0    |
      | 13500.0   |
      | 58500.0   |
      | 5000.0    |
      | 11700.0   |
      | 20000.0   |
      +-----------+
      20 rows selected (0.348 seconds)
      

      The results are, of course, incorrect

      Attachments

        1. DRILL-3359.1.patch
          6 kB
          Sean Hsuan-Yi Chu

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            seanhychu Sean Hsuan-Yi Chu
            adeneche Abdel Hakim Deneche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment