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

ORDER BY should support column position expressions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.3.0
    • Query Processor
    • None

    Description

      The ORDER BY clause does not support column position expresssions, e.g:

      hive> select a.category_desc from lu_category a join lu_subcateg b on a.category_id=b.category_id order by 1;                                                              
      FAILED: Hive Internal Error: java.lang.NullPointerException(null)                     
      java.lang.NullPointerException                                                       
              at org.apache.hadoop.hive.ql.optimizer.ReduceSinkDeDuplication$ReduceSinkDeduplicateProcFactory
      $ReducerReducerProc.getPartitionAndKeyColumnMapping(ReduceSinkDeDuplication.java:406)                                                                     
              at org.apache.hadoop.hive.ql.optimizer.ReduceSinkDeDuplication$ReduceSinkDeduplicateProcFactory
      $ReducerReducerProc.process(ReduceSinkDeDuplication.java:157)       
              at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:89)
              at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:88)
              at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(DefaultGraphWalker.java:128)
              at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:102)
              at org.apache.hadoop.hive.ql.optimizer.ReduceSinkDeDuplication.transform(ReduceSinkDeDuplication.java:88)
              at org.apache.hadoop.hive.ql.optimizer.Optimizer.optimize(Optimizer.java:83)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:6124)
              at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:125)
              at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:304)
              at org.apache.hadoop.hive.ql.Driver.run(Driver.java:379)
              at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:138)
              at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:197)
              at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:302)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cwsteinbach Carl Steinbach
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: