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

Function percentile_cont fails when array parameter passed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: UDF
    • Labels:
      None

      Description

      SELECT
      percentile_cont(array(0.2, 0.5, 0.9)) WITHIN GROUP (ORDER BY value)
      FROM t_test;
      

      hive.log:

      2019-09-24T21:00:43,203 ERROR [LocalJobRunner Map Task Executor #0] mr.ExecMapper: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row
      	at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:573)
      	at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.map(ExecMapper.java:148)
      	at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
      	at org.apache.hadoop.hive.ql.exec.mr.ExecMapRunner.run(ExecMapRunner.java:37)
      	at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:465)
      	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:349)
      	at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:271)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.apache.hadoop.hive.serde2.io.HiveDecimalWritable
      	at org.apache.hadoop.hive.ql.exec.GroupByOperator.process(GroupByOperator.java:793)
      	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:888)
      	at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:95)
      	at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:888)
      	at org.apache.hadoop.hive.ql.exec.TableScanOperator.process(TableScanOperator.java:128)
      	at org.apache.hadoop.hive.ql.exec.MapOperator$MapOpCtx.forward(MapOperator.java:152)
      	at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:552)
      	... 11 more
      Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.apache.hadoop.hive.serde2.io.HiveDecimalWritable
      	at org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentileCont$PercentileContEvaluator.iterate(GenericUDAFPercentileCont.java:259)
      	at org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.aggregate(GenericUDAFEvaluator.java:214)
      	at org.apache.hadoop.hive.ql.exec.GroupByOperator.updateAggregations(GroupByOperator.java:639)
      	at org.apache.hadoop.hive.ql.exec.GroupByOperator.processHashAggr(GroupByOperator.java:814)
      	at org.apache.hadoop.hive.ql.exec.GroupByOperator.processKey(GroupByOperator.java:720)
      	at org.apache.hadoop.hive.ql.exec.GroupByOperator.process(GroupByOperator.java:788)
      	... 17 more
      
      

        Attachments

        1. HIVE-22240.1.patch
          57 kB
          Krisztian Kasa
        2. HIVE-22240.2.patch
          57 kB
          Krisztian Kasa
        3. HIVE-22240.3.patch
          56 kB
          Krisztian Kasa
        4. HIVE-22240.3.patch
          56 kB
          Krisztian Kasa
        5. HIVE-22240.4.patch
          57 kB
          Krisztian Kasa
        6. HIVE-22240.4.patch
          57 kB
          Krisztian Kasa
        7. HIVE-22240.4.patch
          57 kB
          Krisztian Kasa
        8. HIVE-22240.4.patch
          57 kB
          Krisztian Kasa
        9. HIVE-22240.4.patch
          57 kB
          Krisztian Kasa

          Issue Links

            Activity

              People

              • Assignee:
                kkasa Krisztian Kasa
                Reporter:
                kkasa Krisztian Kasa
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: