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

Repeated key in GROUP BY is erroneously displayed when using DISTINCT

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: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.14.0
    • None
    • None

    Description

      The following query was simplified for illustration purposes.

      This works correctly:

      select client_tid, "" as myvalue1, "" as myvalue2 from clients cluster by client_tid
      

      The intent here is to produce two empty columns in between data.

      The following query does not work:

      select distinct client_tid, "" as myvalue1, "" as myvalue2 from clients cluster by client_tid
      
      FAILED: Error in semantic analysis: Line 1:44 Repeated key in GROUP BY ""
      

      The key is not repeated since the aliases were given. Seems like Hive is ignoring the aliases when the "distinct" keyword is specified.

      Attachments

        1. HIVE-2597.4.patch.txt
          44 kB
          Navis Ryu
        2. HIVE-2597.3.patch.txt
          15 kB
          Navis Ryu
        3. HIVE-2597.D8967.2.patch
          37 kB
          Phabricator
        4. HIVE-2597.D8967.1.patch
          32 kB
          Phabricator

        Activity

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

          People

            navis Navis Ryu Assign to me
            arov Alex Rovner
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment