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

sort by does not support columns along with table alias when there is a group by

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      The following query works:

      select a.userid from pageviews a where a.ds = '2009-07-21' sort by a.userid;

      However, the query below results in an error:

      select a.userid, count(1) from pageviews a where a.ds = '2009-07-21' group by a.userid sort by a.userid;

      FAILED: Error in semantic analysis: line 1:109 Invalid Table Alias or Column Reference a

      We should either not allow sort by after a group by or allow sort by to have column aliases always.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rsm Raghotham Murthy
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: