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

semantic analysis error, when using group by and order by together

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.7.0
    • Fix Version/s: 0.13.0
    • Component/s: Query Processor
    • Labels:
      None
    • Environment:

      Ubuntu Karmic, hadoop 0.20.0, hive 0.7.0

      Description

      When I tried queries like, 'select t.c from t group by t.c sort by t.c;', hive reported error ,'FAILED: Error in semantic analysis: line 1:40 Invalid Table Alias or Column Reference t'.
      But 'select t.c from t group by t.c ' or 'select t.c from t sort by t.c;' are ok.

      'select t.c from t group by t.c sort by c;' is ok too.

      The hive server gives stack trace like

      11/01/20 03:07:34 INFO parse.SemanticAnalyzer: Get metadata for subqueries
      11/01/20 03:07:34 INFO parse.SemanticAnalyzer: Get metadata for destination tables
      11/01/20 03:07:34 INFO parse.SemanticAnalyzer: Completed getting MetaData in Semantic Analysis
      FAILED: Error in semantic analysis: line 1:40 Invalid Table Alias or Column Reference t
      11/01/20 03:07:34 ERROR ql.Driver: FAILED: Error in semantic analysis: line 1:40 Invalid Table Alias or Column Reference t
      org.apache.hadoop.hive.ql.parse.SemanticException: line 1:40 Invalid Table Alias or Column Reference t
      at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:6743)
      at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genReduceSinkPlan(SemanticAnalyzer.java:4288)
      at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:5446)
      at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6007)
      at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:6583)
      at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:238)
      at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:343)
      at org.apache.hadoop.hive.ql.Driver.run(Driver.java:731)
      at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:116)
      at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.process(ThriftHive.java:699)
      at org.apache.hadoop.hive.service.ThriftHive$Processor.process(ThriftHive.java:677)
      at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:253)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

        Attachments

          Activity

            People

            • Assignee:
              rhbutani Harish Butani
              Reporter:
              hongwei Hongwei
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified