hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1465149 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/udf/ java/org/apache/hadoop/hive/ql/udf/generic/ test/queries/clientpositive/ test/results/clientpositive/ test/results/compiler/plan/
Date Fri, 05 Apr 2013 22:27:52 GMT
Author: hashutosh
Date: Fri Apr  5 22:27:50 2013
New Revision: 1465149

URL: http://svn.apache.org/r1465149
Log:
HIVE-4128 : Support avg(decimal) (Brock Noland via Ashutosh Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFAverage.java
    hive/trunk/ql/src/test/queries/clientpositive/decimal_udf.q
    hive/trunk/ql/src/test/results/clientpositive/decimal_udf.q.out
    hive/trunk/ql/src/test/results/compiler/plan/groupby3.q.xml

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java?rev=1465149&r1=1465148&r2=1465149&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java Fri Apr  5 22:27:50
2013
@@ -41,7 +41,7 @@ public class UDFOPDivide extends UDF {
   private final DoubleWritable doubleWritable = new DoubleWritable();
   private final BigDecimalWritable bigDecimalWritable = new BigDecimalWritable();
 
-  private final int MAX_SCALE = 65; // max compatible with MySQL
+  public static final int MAX_SCALE = 65; // max compatible with MySQL
 
   public DoubleWritable evaluate(DoubleWritable a, DoubleWritable b) {
     // LOG.info("Get input " + a.getClass() + ":" + a + " " + b.getClass() + ":"

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFAverage.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFAverage.java?rev=1465149&r1=1465148&r2=1465149&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFAverage.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFAverage.java Fri
Apr  5 22:27:50 2013
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.hive.ql.udf.generic;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 
 import org.apache.commons.logging.Log;
@@ -25,12 +27,16 @@ import org.apache.hadoop.hive.ql.exec.De
 import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.parse.SemanticException;
+import org.apache.hadoop.hive.ql.udf.UDFOPDivide;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer;
+import org.apache.hadoop.hive.serde2.io.BigDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.StructField;
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.BigDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
@@ -71,7 +77,9 @@ public class GenericUDAFAverage extends 
     case DOUBLE:
     case STRING:
     case TIMESTAMP:
-      return new GenericUDAFAverageEvaluator();
+      return new GenericUDAFAverageEvaluatorDouble();
+    case DECIMAL:
+      return new GenericUDAFAverageEvaluatorDecimal();
     case BOOLEAN:
     default:
       throw new UDFArgumentTypeException(0,
@@ -80,27 +88,161 @@ public class GenericUDAFAverage extends 
     }
   }
 
-  /**
-   * GenericUDAFAverageEvaluator.
-   *
-   */
-  public static class GenericUDAFAverageEvaluator extends GenericUDAFEvaluator {
 
-    // For PARTIAL1 and COMPLETE
-    PrimitiveObjectInspector inputOI;
+  public static class GenericUDAFAverageEvaluatorDouble extends AbstractGenericUDAFAverageEvaluator<Double>
{
 
-    // For PARTIAL2 and FINAL
-    StructObjectInspector soi;
-    StructField countField;
-    StructField sumField;
-    LongObjectInspector countFieldOI;
-    DoubleObjectInspector sumFieldOI;
+    @Override
+    public void doReset(AverageAggregationBuffer<Double> aggregation) throws HiveException
{
+      aggregation.count = 0;
+      aggregation.sum = new Double(0);
+    }
+
+    @Override
+    protected ObjectInspector getSumFieldJavaObjectInspector() {
+      return PrimitiveObjectInspectorFactory.javaDoubleObjectInspector;
+    }
+    @Override
+    protected ObjectInspector getSumFieldWritableObjectInspector() {
+      return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector;
+    }
+
+    @Override
+    protected void doIterate(AverageAggregationBuffer<Double> aggregation,
+        PrimitiveObjectInspector oi, Object parameter) {
+      double value = PrimitiveObjectInspectorUtils.getDouble(parameter, oi);
+      aggregation.count++;
+      aggregation.sum += value;
+
+    }
+
+    @Override
+    protected void doMerge(AverageAggregationBuffer<Double> aggregation, Long partialCount,
+        ObjectInspector sumFieldOI, Object partialSum) {
+      double value = ((DoubleObjectInspector)sumFieldOI).get(partialSum);
+      aggregation.count += partialCount;
+      aggregation.sum += value;
+    }
+
+    @Override
+    protected void doTerminatePartial(AverageAggregationBuffer<Double> aggregation)
{
+      if(partialResult[1] == null) {
+        partialResult[1] = new DoubleWritable(0);
+      }
+      ((LongWritable) partialResult[0]).set(aggregation.count);
+      ((DoubleWritable) partialResult[1]).set(aggregation.sum);
+    }
+
+    @Override
+    protected Object doTerminate(AverageAggregationBuffer<Double> aggregation) {
+      if(aggregation.count == 0) {
+        return null;
+      } else {
+        DoubleWritable result = new DoubleWritable(0);
+        result.set(aggregation.sum / aggregation.count);
+        return result;
+      }
+    }
+    @Override
+    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
+      AverageAggregationBuffer<Double> result = new AverageAggregationBuffer<Double>();
+      reset(result);
+      return result;
+    }
+  }
+
+  public static class GenericUDAFAverageEvaluatorDecimal extends AbstractGenericUDAFAverageEvaluator<BigDecimal>
{
+
+    @Override
+    public void doReset(AverageAggregationBuffer<BigDecimal> aggregation) throws HiveException
{
+      aggregation.count = 0;
+      aggregation.sum = BigDecimal.ZERO;
+    }
 
+    @Override
+    protected ObjectInspector getSumFieldJavaObjectInspector() {
+      return PrimitiveObjectInspectorFactory.javaBigDecimalObjectInspector;
+    }
+    @Override
+    protected ObjectInspector getSumFieldWritableObjectInspector() {
+      return PrimitiveObjectInspectorFactory.writableBigDecimalObjectInspector;
+    }
+
+    @Override
+    protected void doIterate(AverageAggregationBuffer<BigDecimal> aggregation,
+        PrimitiveObjectInspector oi, Object parameter) {
+      BigDecimal value = PrimitiveObjectInspectorUtils.getBigDecimal(parameter, oi);
+      aggregation.count++;
+      aggregation.sum = aggregation.sum.add(value);
+
+    }
+
+    @Override
+    protected void doMerge(AverageAggregationBuffer<BigDecimal> aggregation, Long partialCount,
+        ObjectInspector sumFieldOI, Object partialSum) {
+      BigDecimal value = ((BigDecimalObjectInspector)sumFieldOI).getPrimitiveJavaObject(partialSum);
+      aggregation.count += partialCount;
+      aggregation.sum = aggregation.sum.add(value);
+    }
+
+    @Override
+    protected void doTerminatePartial(AverageAggregationBuffer<BigDecimal> aggregation)
{
+      if(partialResult[1] == null) {
+        partialResult[1] = new BigDecimalWritable(BigDecimal.ZERO);
+      }
+      ((LongWritable) partialResult[0]).set(aggregation.count);
+      ((BigDecimalWritable) partialResult[1]).set(aggregation.sum);
+    }
+
+    @Override
+    protected Object doTerminate(AverageAggregationBuffer<BigDecimal> aggregation)
{
+      if(aggregation.count == 0) {
+        return null;
+      } else {
+        BigDecimalWritable result = new BigDecimalWritable(BigDecimal.ZERO);
+        result.set(aggregation.sum.divide(new BigDecimal(aggregation.count),
+            UDFOPDivide.MAX_SCALE, RoundingMode.HALF_UP));
+        return result;
+      }
+    }
+    @Override
+    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
+      AverageAggregationBuffer<BigDecimal> result = new AverageAggregationBuffer<BigDecimal>();
+      reset(result);
+      return result;
+    }
+  }
+
+  private static class AverageAggregationBuffer<TYPE> implements AggregationBuffer
{
+    private long count;
+    private TYPE sum;
+  };
+
+  @SuppressWarnings("unchecked")
+  public static abstract class AbstractGenericUDAFAverageEvaluator<TYPE> extends GenericUDAFEvaluator
{
+
+    // For PARTIAL1 and COMPLETE
+    private PrimitiveObjectInspector inputOI;
+    // For PARTIAL2 and FINAL
+    private StructObjectInspector soi;
+    private StructField countField;
+    private StructField sumField;
+    private LongObjectInspector countFieldOI;
+    private ObjectInspector sumFieldOI;
     // For PARTIAL1 and PARTIAL2
-    Object[] partialResult;
+    protected Object[] partialResult;
+
+    private boolean warned = false;
 
-    // For FINAL and COMPLETE
-    DoubleWritable result;
+
+    protected abstract ObjectInspector getSumFieldJavaObjectInspector();
+    protected abstract ObjectInspector getSumFieldWritableObjectInspector();
+    protected abstract void doIterate(AverageAggregationBuffer<TYPE> aggregation,
+        PrimitiveObjectInspector inputOI, Object parameter);
+    protected abstract void doMerge(AverageAggregationBuffer<TYPE> aggregation, Long
partialCount,
+        ObjectInspector sumFieldOI, Object partialSum);
+    protected abstract void doTerminatePartial(AverageAggregationBuffer<TYPE> aggregation);
+    protected abstract Object doTerminate(AverageAggregationBuffer<TYPE> aggregation);
+    protected abstract void doReset(AverageAggregationBuffer<TYPE> aggregation) throws
HiveException;
 
     @Override
     public ObjectInspector init(Mode m, ObjectInspector[] parameters)
@@ -115,9 +257,8 @@ public class GenericUDAFAverage extends 
         soi = (StructObjectInspector) parameters[0];
         countField = soi.getStructFieldRef("count");
         sumField = soi.getStructFieldRef("sum");
-        countFieldOI = (LongObjectInspector) countField
-            .getFieldObjectInspector();
-        sumFieldOI = (DoubleObjectInspector) sumField.getFieldObjectInspector();
+        countFieldOI = (LongObjectInspector) countField.getFieldObjectInspector();
+        sumFieldOI = sumField.getFieldObjectInspector();
       }
 
       // init output
@@ -127,96 +268,63 @@ public class GenericUDAFAverage extends 
 
         ArrayList<ObjectInspector> foi = new ArrayList<ObjectInspector>();
         foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector);
-        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);
+        foi.add(getSumFieldWritableObjectInspector());
         ArrayList<String> fname = new ArrayList<String>();
         fname.add("count");
         fname.add("sum");
         partialResult = new Object[2];
         partialResult[0] = new LongWritable(0);
-        partialResult[1] = new DoubleWritable(0);
+        // index 1 set by child
         return ObjectInspectorFactory.getStandardStructObjectInspector(fname,
             foi);
 
       } else {
-        result = new DoubleWritable(0);
-        return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector;
+        return getSumFieldWritableObjectInspector();
       }
     }
 
-    static class AverageAgg implements AggregationBuffer {
-      long count;
-      double sum;
-    };
-
     @Override
-    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
-      AverageAgg result = new AverageAgg();
-      reset(result);
-      return result;
+    public void reset(AggregationBuffer aggregation) throws HiveException {
+      doReset((AverageAggregationBuffer<TYPE>)aggregation);
     }
 
     @Override
-    public void reset(AggregationBuffer agg) throws HiveException {
-      AverageAgg myagg = (AverageAgg) agg;
-      myagg.count = 0;
-      myagg.sum = 0;
-    }
-
-    boolean warned = false;
-
-    @Override
-    public void iterate(AggregationBuffer agg, Object[] parameters)
+    public void iterate(AggregationBuffer aggregation, Object[] parameters)
         throws HiveException {
       assert (parameters.length == 1);
-      Object p = parameters[0];
-      if (p != null) {
-        AverageAgg myagg = (AverageAgg) agg;
+      Object parameter = parameters[0];
+      if (parameter != null) {
+        AverageAggregationBuffer<TYPE> averageAggregation = (AverageAggregationBuffer<TYPE>)
aggregation;
         try {
-          double v = PrimitiveObjectInspectorUtils.getDouble(p, inputOI);
-          myagg.count++;
-          myagg.sum += v;
+          doIterate(averageAggregation, inputOI, parameter);
         } catch (NumberFormatException e) {
           if (!warned) {
             warned = true;
-            LOG.warn(getClass().getSimpleName() + " "
-                + StringUtils.stringifyException(e));
-            LOG.warn(getClass().getSimpleName()
-                + " ignoring similar exceptions.");
+            LOG.warn("Ignoring similar exceptions: " + StringUtils.stringifyException(e));
           }
         }
       }
     }
 
     @Override
-    public Object terminatePartial(AggregationBuffer agg) throws HiveException {
-      AverageAgg myagg = (AverageAgg) agg;
-      ((LongWritable) partialResult[0]).set(myagg.count);
-      ((DoubleWritable) partialResult[1]).set(myagg.sum);
+    public Object terminatePartial(AggregationBuffer aggregation) throws HiveException {
+      doTerminatePartial((AverageAggregationBuffer<TYPE>) aggregation);
       return partialResult;
     }
 
     @Override
-    public void merge(AggregationBuffer agg, Object partial)
+    public void merge(AggregationBuffer aggregation, Object partial)
         throws HiveException {
       if (partial != null) {
-        AverageAgg myagg = (AverageAgg) agg;
-        Object partialCount = soi.getStructFieldData(partial, countField);
-        Object partialSum = soi.getStructFieldData(partial, sumField);
-        myagg.count += countFieldOI.get(partialCount);
-        myagg.sum += sumFieldOI.get(partialSum);
+        doMerge((AverageAggregationBuffer<TYPE>)aggregation,
+            countFieldOI.get(soi.getStructFieldData(partial, countField)),
+            sumFieldOI, soi.getStructFieldData(partial, sumField));
       }
     }
 
     @Override
-    public Object terminate(AggregationBuffer agg) throws HiveException {
-      AverageAgg myagg = (AverageAgg) agg;
-      if (myagg.count == 0) {
-        return null;
-      } else {
-        result.set(myagg.sum / myagg.count);
-        return result;
-      }
+    public Object terminate(AggregationBuffer aggregation) throws HiveException {
+      return doTerminate((AverageAggregationBuffer<TYPE>)aggregation);
     }
   }
-
 }

Modified: hive/trunk/ql/src/test/queries/clientpositive/decimal_udf.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/decimal_udf.q?rev=1465149&r1=1465148&r2=1465149&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/decimal_udf.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/decimal_udf.q Fri Apr  5 22:27:50 2013
@@ -69,6 +69,10 @@ SELECT key / '2.0' FROM DECIMAL_UDF;
 EXPLAIN SELECT abs(key) FROM DECIMAL_UDF;
 SELECT abs(key) FROM DECIMAL_UDF;
 
+-- avg
+EXPLAIN SELECT value, sum(key) / count(key), avg(key) FROM DECIMAL_UDF GROUP BY value ORDER
BY value;
+SELECT value, sum(key) / count(key), avg(key) FROM DECIMAL_UDF GROUP BY value ORDER BY value;
+
 -- negative
 EXPLAIN SELECT -key FROM DECIMAL_UDF;
 SELECT -key FROM DECIMAL_UDF;

Modified: hive/trunk/ql/src/test/results/clientpositive/decimal_udf.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/decimal_udf.q.out?rev=1465149&r1=1465148&r2=1465149&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/decimal_udf.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/decimal_udf.q.out Fri Apr  5 22:27:50 2013
@@ -1478,6 +1478,145 @@ POSTHOOK: Input: default@decimal_udf
 0.9999999999999999999999999
 1234567890.123456789
 1234567890.12345678
+PREHOOK: query: -- avg
+EXPLAIN SELECT value, sum(key) / count(key), avg(key) FROM DECIMAL_UDF GROUP BY value ORDER
BY value
+PREHOOK: type: QUERY
+POSTHOOK: query: -- avg
+EXPLAIN SELECT value, sum(key) / count(key), avg(key) FROM DECIMAL_UDF GROUP BY value ORDER
BY value
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME DECIMAL_UDF))) (TOK_INSERT (TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL value)) (TOK_SELEXPR (/
(TOK_FUNCTION sum (TOK_TABLE_OR_COL key)) (TOK_FUNCTION count (TOK_TABLE_OR_COL key)))) (TOK_SELEXPR
(TOK_FUNCTION avg (TOK_TABLE_OR_COL key)))) (TOK_GROUPBY (TOK_TABLE_OR_COL value)) (TOK_ORDERBY
(TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL value)))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        decimal_udf 
+          TableScan
+            alias: decimal_udf
+            Select Operator
+              expressions:
+                    expr: value
+                    type: int
+                    expr: key
+                    type: decimal
+              outputColumnNames: value, key
+              Group By Operator
+                aggregations:
+                      expr: sum(key)
+                      expr: count(key)
+                      expr: avg(key)
+                bucketGroup: false
+                keys:
+                      expr: value
+                      type: int
+                mode: hash
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col1
+                        type: decimal
+                        expr: _col2
+                        type: bigint
+                        expr: _col3
+                        type: struct<count:bigint,sum:decimal>
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: sum(VALUE._col0)
+                expr: count(VALUE._col1)
+                expr: avg(VALUE._col2)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: (_col1 / _col2)
+                  type: decimal
+                  expr: _col3
+                  type: decimal
+            outputColumnNames: _col0, _col1, _col2
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              tag: -1
+              value expressions:
+                    expr: _col0
+                    type: int
+                    expr: _col1
+                    type: decimal
+                    expr: _col2
+                    type: decimal
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 0
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: SELECT value, sum(key) / count(key), avg(key) FROM DECIMAL_UDF GROUP BY value
ORDER BY value
+PREHOOK: type: QUERY
+PREHOOK: Input: default@decimal_udf
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT value, sum(key) / count(key), avg(key) FROM DECIMAL_UDF GROUP BY
value ORDER BY value
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@decimal_udf
+#### A masked pattern was here ####
+-1234567890	-1234567890.123456789	-1234567890.123456789
+-1255	-1255.49	-1255.49
+-11	-1.122	-1.122
+-1	-1.12	-1.12
+0	71428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571.45214285714285714285714285714285714285714285714285714285714285714
71428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571.45214285714285714285714285714285714285714285714285714285714285714
+1	1.04839999999999999999999998	1.04839999999999999999999998
+2	2	2
+3	3.14	3.14
+4	3.14	3.14
+10	1E+1	1E+1
+20	2E+1	2E+1
+100	1E+2	1E+2
+124	124	124
+125	125.2	125.2
+200	2E+2	2E+2
+4400	-4.4E+3	-4.4E+3
+1234567890	1234567890.12345678	1234567890.12345678
 PREHOOK: query: -- negative
 EXPLAIN SELECT -key FROM DECIMAL_UDF
 PREHOOK: type: QUERY

Modified: hive/trunk/ql/src/test/results/compiler/plan/groupby3.q.xml
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/compiler/plan/groupby3.q.xml?rev=1465149&r1=1465148&r2=1465149&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/compiler/plan/groupby3.q.xml (original)
+++ hive/trunk/ql/src/test/results/compiler/plan/groupby3.q.xml Fri Apr  5 22:27:50 2013
@@ -630,7 +630,7 @@
                     <void method="add"> 
                      <object class="org.apache.hadoop.hive.ql.plan.AggregationDesc">

                       <void property="genericUDAFEvaluator"> 
-                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluator0" class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluator"/>

+                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble0"
class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble"/>

                       </void> 
                       <void property="genericUDAFName"> 
                        <string>avg</string> 
@@ -697,7 +697,7 @@
                        <boolean>true</boolean> 
                       </void> 
                       <void property="genericUDAFEvaluator"> 
-                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluator1" class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluator"/>

+                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble1"
class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble"/>

                       </void> 
                       <void property="genericUDAFName"> 
                        <string>avg</string> 
@@ -1922,7 +1922,7 @@
           <void method="add"> 
            <object class="org.apache.hadoop.hive.ql.plan.AggregationDesc"> 
             <void property="genericUDAFEvaluator"> 
-             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluator0"/> 
+             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble0"/>

             </void> 
             <void property="genericUDAFName"> 
              <string>avg</string> 
@@ -1952,7 +1952,7 @@
              <boolean>true</boolean> 
             </void> 
             <void property="genericUDAFEvaluator"> 
-             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluator1"/> 
+             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble1"/>

             </void> 
             <void property="genericUDAFName"> 
              <string>avg</string> 



Mime
View raw message