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

Simple UDAFs with more than 1 parameter crash on empty row query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6.0
    • 0.7.0
    • Query Processor
    • None

    Description

      Simple UDAFs with more than 1 parameter crash when the query returns no rows. Currently, this only seems to affect the percentile() UDAF where the second parameter is the percentile to be computed (of type double). I've also verified the bug by adding a dummy parameter to ExampleMin in contrib.

      On an empty query, Hive seems to be trying to resolve an iterate() method with signature

      {null,null}

      instead of

      {null,double}

      . You can reproduce this bug using:

      CREATE TABLE pct_test ( val INT );
      SELECT percentile(val, 0.5) FROM pct_test;

      which produces a lot of errors like:

      Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to execute method public boolean org.apache.hadoop.hive.ql.udf.UDAFPercentile$PercentileLongEvaluator.iterate(org.apache.hadoop.io.LongWritable,double) on object org.apache.hadoop.hive.ql.udf.UDAFPercentile$PercentileLongEvaluator@11d13272 of class org.apache.hadoop.hive.ql.udf.UDAFPercentile$PercentileLongEvaluator with arguments

      {null, null}

      of size 2

      Attachments

        1. HIVE-1376.2.patch
          9 kB
          Ning Zhang
        2. HIVE-1376.patch
          19 kB
          Ning Zhang

        Activity

          People

            nzhang Ning Zhang
            mayanklahiri Mayank Lahiri
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: