Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-4934

Improve documentation of OVER clause

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      CREATE TABLE test (foo INT);
      SELECT ntile(10), foo OVER (PARTITION BY foo) FROM test;
      FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: Only COMPLETE mode supported for NTile function
      
      SELECT foo, ntile(10) OVER (PARTITION BY foo) FROM test;
      ...works...
      

      I'm not sure if that is a bug or necessary. Either way the error message is not helpful as it's not documented anywhere what COMPLETE mode is. A cursory glance at the code didn't help me either.

      Edit: It is not a bug, it wasn't clear to me that the OVER clause only applies to the directly preceding function.

      Attachments

        Activity

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

          People

            larsfrancke Lars Francke Assign to me
            larsfrancke Lars Francke
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment