hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1660751 [6/23] - in /hive/branches/cbo: ./ accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/serde/ accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/ accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/mr/ accumulo-h...
Date Wed, 18 Feb 2015 22:28:40 GMT
Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java Wed Feb 18 22:28:35 2015
@@ -18,16 +18,15 @@
 
 package org.apache.hadoop.hive.ql.udf.generic;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.Converter;
+import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.Text;
 
@@ -85,7 +84,7 @@ public abstract class GenericUDFBasePad
 
   @Override
   public String getDisplayString(String[] children) {
-    return udfName + "(" + StringUtils.join(children, ", ") + ")";
+    return getStandardDisplayString(udfName, children);
   }
 
   protected abstract void performOp(byte[] data, byte[] txt, byte[] padTxt, int len, Text str,

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java Wed Feb 18 22:28:35 2015
@@ -78,7 +78,7 @@ public abstract class GenericUDFBaseTrim
 
   @Override
   public String getDisplayString(String[] children) {
-    return udfName + "(" + StringUtils.join(children, ", ") + ")";
+    return getStandardDisplayString(udfName, children);
   }
 
   protected abstract String performOp(String val);

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java Wed Feb 18 22:28:35 2015
@@ -69,17 +69,7 @@ public class GenericUDFCoalesce extends
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("COALESCE(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(",");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("COALESCE", children, ",");
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java Wed Feb 18 22:28:35 2015
@@ -205,17 +205,7 @@ public class GenericUDFConcat extends Ge
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("concat(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(", ");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("concat", children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java Wed Feb 18 22:28:35 2015
@@ -142,12 +142,6 @@ public class GenericUDFConcatWS extends
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length >= 2);
-    StringBuilder sb = new StringBuilder();
-    sb.append("concat_ws(");
-    for (int i = 0; i < children.length - 1; i++) {
-      sb.append(children[i]).append(", ");
-    }
-    sb.append(children[children.length - 1]).append(")");
-    return sb.toString();
+    return getStandardDisplayString("concat_ws", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java Wed Feb 18 22:28:35 2015
@@ -131,17 +131,7 @@ public class GenericUDFDate extends Gene
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("to_date(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(", ");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("to_date", children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java Wed Feb 18 22:28:35 2015
@@ -196,16 +196,6 @@ public class GenericUDFDateAdd extends G
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("date_add(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(", ");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("date_add", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java Wed Feb 18 22:28:35 2015
@@ -96,17 +96,7 @@ public class GenericUDFDateDiff extends
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("datediff(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(", ");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("datediff", children);
   }
 
   private Date convertToDate(PrimitiveCategory inputType, Converter converter, DeferredObject argument)

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java Wed Feb 18 22:28:35 2015
@@ -196,16 +196,6 @@ public class GenericUDFDateSub extends G
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("date_sub(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(", ");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("date_sub", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java Wed Feb 18 22:28:35 2015
@@ -113,10 +113,6 @@ public class GenericUDFDecode extends Ge
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    StringBuilder sb = new StringBuilder();
-    sb.append("decode(");
-    sb.append(children[0]).append(",");
-    sb.append(children[1]).append(")");
-    return sb.toString();
+    return getStandardDisplayString("decode", children, ",");
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java Wed Feb 18 22:28:35 2015
@@ -95,15 +95,6 @@ public ObjectInspector initialize(Object
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("EWAH_BITMAP_EMPTY(");
-    for (int i = 0; i < children.length; i++) {
-      sb.append(children[i]);
-      if (i + 1 != children.length) {
-        sb.append(",");
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("EWAH_BITMAP_EMPTY", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java Wed Feb 18 22:28:35 2015
@@ -92,12 +92,6 @@ public class GenericUDFElt extends Gener
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length >= 2);
-    StringBuilder sb = new StringBuilder();
-    sb.append("elt(");
-    for (int i = 0; i < children.length - 1; i++) {
-      sb.append(children[i]).append(", ");
-    }
-    sb.append(children[children.length - 1]).append(")");
-    return sb.toString();
+    return getStandardDisplayString("elt", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java Wed Feb 18 22:28:35 2015
@@ -113,10 +113,6 @@ public class GenericUDFEncode extends Ge
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    StringBuilder sb = new StringBuilder();
-    sb.append("encode(");
-    sb.append(children[0]).append(",");
-    sb.append(children[1]).append(")");
-    return sb.toString();
+    return getStandardDisplayString("encode", children, ",");
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java Wed Feb 18 22:28:35 2015
@@ -90,12 +90,6 @@ public class GenericUDFField extends Gen
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length >= 2);
-
-    final StringBuilder sb = new StringBuilder();
-    sb.append("field(");
-    sb.append(StringUtils.join(children, ", "));
-    sb.append(")");
-
-    return sb.toString();
+    return getStandardDisplayString("field", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java Wed Feb 18 22:28:35 2015
@@ -128,7 +128,7 @@ public abstract class GenericUDFFloorCei
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 1);
-    return opDisplayName + "(" + children[0] + ")";
+    return getStandardDisplayString(opDisplayName, children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java Wed Feb 18 22:28:35 2015
@@ -220,12 +220,6 @@ public class GenericUDFFormatNumber exte
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    StringBuilder sb = new StringBuilder();
-    sb.append("format_number(");
-    for (int i = 0; i < children.length - 1; i++) {
-      sb.append(children[i]).append(", ");
-    }
-    sb.append(children[children.length - 1]).append(")");
-    return sb.toString();
+    return getStandardDisplayString("format_number", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java Wed Feb 18 22:28:35 2015
@@ -32,11 +32,10 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorConverter.TextConverter;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorConverter.TimestampConverter;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
-import org.apache.hadoop.io.Text;
 
 @Description(name = "from_utc_timestamp",
              value = "from_utc_timestamp(timestamp, string timezone) - "
-                     + "Assumes given timestamp ist UTC and converts to given timezone (as of Hive 0.8.0)")
+                     + "Assumes given timestamp is UTC and converts to given timezone (as of Hive 0.8.0)")
 public class GenericUDFFromUtcTimestamp extends GenericUDF {
 
   static final Log LOG = LogFactory.getLog(GenericUDFFromUtcTimestamp.class);
@@ -48,17 +47,14 @@ public class GenericUDFFromUtcTimestamp
   @Override
   public ObjectInspector initialize(ObjectInspector[] arguments)
       throws UDFArgumentException {
-    if (arguments.length < 2) {
-      throw new UDFArgumentLengthException(
-          "The function " + getName() + " requires at least two "
+    if (arguments.length != 2) {
+      throw new UDFArgumentLengthException("The function " + getName() + " requires two "
           + "argument, got " + arguments.length);
     }
     try {
       argumentOIs = new PrimitiveObjectInspector[2];
       argumentOIs[0] = (PrimitiveObjectInspector) arguments[0];
-      if (arguments.length > 1) {
-        argumentOIs[1] = (PrimitiveObjectInspector) arguments[1];
-      }
+      argumentOIs[1] = (PrimitiveObjectInspector) arguments[1];
     } catch (ClassCastException e) {
       throw new UDFArgumentException(
           "The function " + getName() + " takes only primitive types");
@@ -73,20 +69,17 @@ public class GenericUDFFromUtcTimestamp
   @Override
   public Object evaluate(DeferredObject[] arguments) throws HiveException {
     Object o0 = arguments[0].get();
-    TimeZone timezone = null;
     if (o0 == null) {
       return null;
     }
-
-    if (arguments.length > 1 && arguments[1] != null) {
-      Text text = textConverter.convert(arguments[1].get());
-      if (text != null) {
-        timezone = TimeZone.getTimeZone(text.toString());
-      }
-    } else {
+    Object o1 = arguments[1].get();
+    if (o1 == null) {
       return null;
     }
 
+    String tzStr = textConverter.convert(o1).toString();
+    TimeZone timezone = TimeZone.getTimeZone(tzStr);
+
     Timestamp timestamp = ((TimestampWritable) timestampConverter.convert(o0))
         .getTimestamp();
 

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java Wed Feb 18 22:28:35 2015
@@ -94,17 +94,7 @@ public class GenericUDFGreatest extends
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append(getFuncName()).append("(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(",");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString(getFuncName(), children, ",");
   }
 
   protected String getFuncName() {

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java Wed Feb 18 22:28:35 2015
@@ -58,7 +58,7 @@ public class GenericUDFHash extends Gene
 
   @Override
   public String getDisplayString(String[] children) {
-    return "hash(" + StringUtils.join(children, ',') + ")";
+    return getStandardDisplayString("hash", children, ",");
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java Wed Feb 18 22:28:35 2015
@@ -139,11 +139,6 @@ public class GenericUDFIf extends Generi
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 3);
-    StringBuilder sb = new StringBuilder();
-    sb.append("if(");
-    sb.append(children[0]).append(", ");
-    sb.append(children[1]).append(", ");
-    sb.append(children[2]).append(")");
-    return sb.toString();
+    return getStandardDisplayString("if", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java Wed Feb 18 22:28:35 2015
@@ -165,6 +165,6 @@ public class GenericUDFInFile extends Ge
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    return "in_file(" + children[0] + ", " + children[1] + ")";
+    return getStandardDisplayString("in_file", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java Wed Feb 18 22:28:35 2015
@@ -108,16 +108,6 @@ public class GenericUDFInitCap extends G
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("initcap(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(",");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("initcap", children);
   }
 }
\ No newline at end of file

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java Wed Feb 18 22:28:35 2015
@@ -93,6 +93,6 @@ public class GenericUDFInstr extends Gen
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    return "instr(" + children[0] + children[1] + ")";
+    return getStandardDisplayString("instr", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java Wed Feb 18 22:28:35 2015
@@ -133,17 +133,7 @@ public class GenericUDFLastDay extends G
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("last_day(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(", ");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("last_day", children);
   }
 
   protected Calendar lastDay(Date d) {

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java Wed Feb 18 22:28:35 2015
@@ -165,14 +165,7 @@ public abstract class GenericUDFLeadLag
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    StringBuilder sb = new StringBuilder();
-    sb.append(_getFnName());
-    sb.append("(");
-    sb.append(children[0]);
-    sb.append(", ");
-    sb.append(children[1]);
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString(_getFnName(), children);
   }
 
   protected abstract String _getFnName();

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java Wed Feb 18 22:28:35 2015
@@ -109,7 +109,6 @@ public class GenericUDFLocate extends Ge
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2 || children.length == 3);
-    return "locate(" + children[0] + children[1]
-        + (children.length == 3 ? children[2] : "") + ")";
+    return getStandardDisplayString("locate", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java Wed Feb 18 22:28:35 2015
@@ -105,17 +105,7 @@ public class GenericUDFLower extends Gen
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("lower(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(",");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("lower", children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java Wed Feb 18 22:28:35 2015
@@ -128,17 +128,7 @@ public class GenericUDFMacro extends Gen
 
   @Override
   public String getDisplayString(String[] children) {
-      StringBuilder sb = new StringBuilder();
-      sb.append(macroName);
-      sb.append("(");
-      for (int i = 0; i < children.length; i++) {
-        sb.append(children[i]);
-        if (i + 1 < children.length) {
-          sb.append(", ");
-        }
-      }
-      sb.append(")");
-      return sb.toString();
+      return getStandardDisplayString(macroName, children);
   }
 
   public void setMacroName(String macroName) {

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java Wed Feb 18 22:28:35 2015
@@ -68,6 +68,6 @@ public class GenericUDFMapKeys extends G
   @Override
   public String getDisplayString(String[] children) {
     assert children.length == 1;
-    return "map_keys(" + children[0] + ")";
+    return getStandardDisplayString("map_keys", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java Wed Feb 18 22:28:35 2015
@@ -68,6 +68,6 @@ public class GenericUDFMapValues extends
   @Override
   public String getDisplayString(String[] children) {
     assert children.length == 1;
-    return "map_values(" + children[0] + ")";
+    return getStandardDisplayString("map_values", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java Wed Feb 18 22:28:35 2015
@@ -75,15 +75,6 @@ public class GenericUDFNamedStruct exten
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("named_struct(");
-    for (int i = 0; i < children.length; i++) {
-      if (i > 0) {
-        sb.append(',');
-      }
-      sb.append(children[i]);
-    }
-    sb.append(')');
-    return sb.toString();
+    return getStandardDisplayString("named_struct", children, ",");
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPower.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPower.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPower.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPower.java Wed Feb 18 22:28:35 2015
@@ -41,7 +41,6 @@ extended = "Example:\n"
 @VectorizedExpressions({FuncPowerLongToDouble.class, FuncPowerDoubleToDouble.class})
 public class GenericUDFPower extends GenericUDF {
   private final String opName;
-  private final String opDisplayName;
 
   private transient PrimitiveObjectInspector baseOI;
   private transient PrimitiveObjectInspector powerOI;
@@ -54,7 +53,6 @@ public class GenericUDFPower extends Gen
 
   public GenericUDFPower() {
     opName = getClass().getSimpleName();
-    opDisplayName = "power";
     resultOI = PrimitiveObjectInspectorFactory.writableDoubleObjectInspector;
   }
 
@@ -103,7 +101,7 @@ public class GenericUDFPower extends Gen
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    return opDisplayName + "(" + children[0] + ", " + children[1] + ")";
+    return getStandardDisplayString("power", children);
   }
 
   @Override

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPrintf.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPrintf.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPrintf.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPrintf.java Wed Feb 18 22:28:35 2015
@@ -141,12 +141,6 @@ public class GenericUDFPrintf extends Ge
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length >= 2);
-    StringBuilder sb = new StringBuilder();
-    sb.append("printf(");
-    for (int i = 0; i < children.length - 1; i++) {
-      sb.append(children[i]).append(", ");
-    }
-    sb.append(children[children.length - 1]).append(")");
-    return sb.toString();
+    return getStandardDisplayString("printf", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFRound.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFRound.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFRound.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFRound.java Wed Feb 18 22:28:35 2015
@@ -22,6 +22,7 @@ import org.apache.hadoop.hive.common.typ
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
 import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.FuncRoundWithNumDigitsDecimalToDecimal;
 import org.apache.hadoop.hive.ql.exec.vector.expressions.RoundWithNumDigitsDoubleToDouble;
@@ -83,38 +84,42 @@ public class GenericUDFRound extends Gen
           "ROUND requires one or two argument, got " + arguments.length);
     }
 
-    inputOI = (PrimitiveObjectInspector) arguments[0];
-    if (inputOI.getCategory() != Category.PRIMITIVE) {
-      throw new UDFArgumentException(
-          "ROUND input only takes primitive types, got " + inputOI.getTypeName());
+    if (arguments[0].getCategory() != Category.PRIMITIVE) {
+      throw new UDFArgumentTypeException(0,
+          "ROUND input only takes primitive types, got " + arguments[0].getTypeName());
     }
+    inputOI = (PrimitiveObjectInspector) arguments[0];
 
     if (arguments.length == 2) {
+      if (arguments[1].getCategory() != Category.PRIMITIVE) {
+        throw new UDFArgumentTypeException(1,
+            "ROUND second argument only takes primitive types, got " + arguments[1].getTypeName());
+      }
       PrimitiveObjectInspector scaleOI = (PrimitiveObjectInspector) arguments[1];
       switch (scaleOI.getPrimitiveCategory()) {
       case VOID:
         break;
       case BYTE:
         if (!(scaleOI instanceof WritableConstantByteObjectInspector)) {
-          throw new UDFArgumentException("ROUND second argument only takes constant");
+          throw new UDFArgumentTypeException(1, "ROUND second argument only takes constant");
         }
         scale = ((WritableConstantByteObjectInspector)scaleOI).getWritableConstantValue().get();
         break;
       case SHORT:
         if (!(scaleOI instanceof WritableConstantShortObjectInspector)) {
-          throw new UDFArgumentException("ROUND second argument only takes constant");
+          throw new UDFArgumentTypeException(1, "ROUND second argument only takes constant");
         }
         scale = ((WritableConstantShortObjectInspector)scaleOI).getWritableConstantValue().get();
         break;
       case INT:
         if (!(scaleOI instanceof WritableConstantIntObjectInspector)) {
-          throw new UDFArgumentException("ROUND second argument only takes constant");
+          throw new UDFArgumentTypeException(1, "ROUND second argument only takes constant");
         }
         scale = ((WritableConstantIntObjectInspector)scaleOI).getWritableConstantValue().get();
         break;
       case LONG:
         if (!(scaleOI instanceof WritableConstantLongObjectInspector)) {
-          throw new UDFArgumentException("ROUND second argument only takes constant");
+          throw new UDFArgumentTypeException(1, "ROUND second argument only takes constant");
         }
         long l = ((WritableConstantLongObjectInspector)scaleOI).getWritableConstantValue().get();
         if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) {
@@ -123,7 +128,7 @@ public class GenericUDFRound extends Gen
         scale = (int)l;
         break;
       default:
-        throw new UDFArgumentException("ROUND second argument only takes integer constant");
+        throw new UDFArgumentTypeException(1, "ROUND second argument only takes integer constant");
       }
     }
 
@@ -151,8 +156,9 @@ public class GenericUDFRound extends Gen
       converterFromString = ObjectInspectorConverters.getConverter(inputOI, outputOI);
       break;
     default:
-      throw new UDFArgumentException("Only numeric data types are allowed for ROUND function. Got " +
-          inputType.name());
+      throw new UDFArgumentTypeException(0,
+          "Only numeric or string group data types are allowed for ROUND function. Got "
+              + inputType.name());
     }
 
     return outputOI;
@@ -240,8 +246,9 @@ public class GenericUDFRound extends Gen
        }
        return round(doubleValue, scale);
      default:
-       throw new UDFArgumentException("Only numeric data types are allowed for ROUND function. Got " +
-           inputType.name());
+      throw new UDFArgumentTypeException(0,
+          "Only numeric or string group data types are allowed for ROUND function. Got "
+              + inputType.name());
     }
   }
 
@@ -256,17 +263,7 @@ public class GenericUDFRound extends Gen
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("round(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(", ");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("round", children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSentences.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSentences.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSentences.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSentences.java Wed Feb 18 22:28:35 2015
@@ -128,14 +128,6 @@ public class GenericUDFSentences extends
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length >= 1 && children.length <= 3);
-    String display = "sentences(" + children[0];
-    if(children.length > 1) {
-      display += ", " + children[1];
-      if(children.length > 2) {
-        display += ", " + children[2];
-      }
-    }
-    display += ")";
-    return display;
+    return getStandardDisplayString("sentences", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSize.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSize.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSize.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSize.java Wed Feb 18 22:28:35 2015
@@ -79,6 +79,6 @@ public class GenericUDFSize extends Gene
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 1);
-    return "size(" + children[0] + ")";
+    return getStandardDisplayString("size", children);
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSortArray.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSortArray.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSortArray.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSortArray.java Wed Feb 18 22:28:35 2015
@@ -116,6 +116,6 @@ public class GenericUDFSortArray extends
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 1);
-    return "sort_array(" + children[0] + ")";
+    return getStandardDisplayString("sort_array", children);
  }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSplit.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSplit.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSplit.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSplit.java Wed Feb 18 22:28:35 2015
@@ -82,7 +82,7 @@ public class GenericUDFSplit extends Gen
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
-    return "split(" + children[0] + ", " + children[1] + ")";
+    return getStandardDisplayString("split", children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStringToMap.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStringToMap.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStringToMap.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStringToMap.java Wed Feb 18 22:28:35 2015
@@ -104,19 +104,7 @@ public class GenericUDFStringToMap exten
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("str_to_map(");
     assert (children.length <= 3);
-    boolean firstChild = true;
-    for (String child : children) {
-      if (firstChild) {
-        firstChild = false;
-      } else {
-        sb.append(",");
-      }
-      sb.append(child);
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("str_to_map", children, ",");
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStruct.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStruct.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStruct.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFStruct.java Wed Feb 18 22:28:35 2015
@@ -59,15 +59,6 @@ public class GenericUDFStruct extends Ge
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("struct(");
-    for (int i = 0; i < children.length; i++) {
-      if (i > 0) {
-        sb.append(',');
-      }
-      sb.append(children[i]);
-    }
-    sb.append(')');
-    return sb.toString();
+    return getStandardDisplayString("struct", children, ",");
   }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTranslate.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTranslate.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTranslate.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTranslate.java Wed Feb 18 22:28:35 2015
@@ -287,7 +287,7 @@ public class GenericUDFTranslate extends
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 3);
-    return "translate(" + children[0] + ", " + children[1] + ", " + children[2] + ")";
+    return getStandardDisplayString("translate", children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUpper.java Wed Feb 18 22:28:35 2015
@@ -107,17 +107,7 @@ public class GenericUDFUpper extends Gen
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("upper(");
-    if (children.length > 0) {
-      sb.append(children[0]);
-      for (int i = 1; i < children.length; i++) {
-        sb.append(",");
-        sb.append(children[i]);
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("upper", children);
   }
 
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/NumDistinctValueEstimator.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/NumDistinctValueEstimator.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/NumDistinctValueEstimator.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/NumDistinctValueEstimator.java Wed Feb 18 22:28:35 2015
@@ -35,18 +35,18 @@ public class NumDistinctValueEstimator {
    * independent. As a consequence, the hash values will not distribute uniformly from 0 to 2^p-1
    * thus introducing errors in the estimates.
    */
-  private static final int bitVectorSize = 31;
-  private int numBitVectors;
+  private static final int BIT_VECTOR_SIZE = 31;
+  private final int numBitVectors;
 
   // Refer to Flajolet-Martin'86 for the value of phi
-  private final double phi =  0.77351;
+  private static final double PHI = 0.77351;
 
-  private int[] a;
-  private int[] b;
-  private  FastBitSet[] bitVector = new FastBitSet[numBitVectors];
+  private final int[] a;
+  private final int[] b;
+  private final FastBitSet[] bitVector;
 
-  private Random aValue;
-  private Random bValue;
+  private final Random aValue;
+  private final Random bValue;
 
   /* Create a new distinctValueEstimator
    */
@@ -54,7 +54,7 @@ public class NumDistinctValueEstimator {
     this.numBitVectors = numBitVectors;
     bitVector = new FastBitSet[numBitVectors];
     for (int i=0; i< numBitVectors; i++) {
-      bitVector[i] = new FastBitSet(bitVectorSize);
+      bitVector[i] = new FastBitSet(BIT_VECTOR_SIZE);
     }
 
     a = new int[numBitVectors];
@@ -98,23 +98,30 @@ public class NumDistinctValueEstimator {
       b[i] = randVal;
 
       if (a[i] < 0) {
-        a[i] = a[i] + (1 << bitVectorSize - 1);
+        a[i] = a[i] + (1 << BIT_VECTOR_SIZE - 1);
       }
 
       if (b[i] < 0) {
-        b[i] = b[i] + (1 << bitVectorSize - 1);
+        b[i] = b[i] + (1 << BIT_VECTOR_SIZE - 1);
       }
     }
   }
 
   public NumDistinctValueEstimator(String s, int numBitVectors) {
-    FastBitSet b[] = deserialize(s, numBitVectors);
+    this.numBitVectors = numBitVectors;
+    FastBitSet bitVectorDeser[] = deserialize(s, numBitVectors);
     bitVector = new FastBitSet[numBitVectors];
     for(int i=0; i <numBitVectors; i++) {
-       bitVector[i] = new FastBitSet(bitVectorSize);
+       bitVector[i] = new FastBitSet(BIT_VECTOR_SIZE);
        bitVector[i].clear();
-       bitVector[i].or(b[i]);
+       bitVector[i].or(bitVectorDeser[i]);
     }
+
+    a = null;
+    b = null;
+
+    aValue = null;
+    bValue = null;
   }
 
   /**
@@ -135,7 +142,7 @@ public class NumDistinctValueEstimator {
   }
 
   public int getBitVectorSize() {
-    return bitVectorSize;
+    return BIT_VECTOR_SIZE;
   }
 
   public void printNumDistinctValueEstimator() {
@@ -145,7 +152,7 @@ public class NumDistinctValueEstimator {
     LOG.debug("Number of Vectors:");
     LOG.debug(numBitVectors);
     LOG.debug("Vector Size: ");
-    LOG.debug(bitVectorSize);
+    LOG.debug(BIT_VECTOR_SIZE);
 
     for (int i=0; i < numBitVectors; i++) {
       t = t + bitVector[i].toString();
@@ -173,7 +180,7 @@ public class NumDistinctValueEstimator {
   private FastBitSet[] deserialize(String s, int numBitVectors) {
     FastBitSet[] b = new FastBitSet[numBitVectors];
     for (int j=0; j < numBitVectors; j++) {
-      b[j] = new FastBitSet(bitVectorSize);
+      b[j] = new FastBitSet(BIT_VECTOR_SIZE);
       b[j].clear();
     }
 
@@ -219,7 +226,7 @@ public class NumDistinctValueEstimator {
   }
 
   private int generateHash(long v, int hashNum) {
-    int mod = (1<<bitVectorSize) - 1;
+    int mod = (1<<BIT_VECTOR_SIZE) - 1;
     long tempHash = a[hashNum] * v  + b[hashNum];
     tempHash %= mod;
     int hash = (int) tempHash;
@@ -234,7 +241,7 @@ public class NumDistinctValueEstimator {
   }
 
   private int generateHashForPCSA(long v) {
-    int mod = 1 << (bitVectorSize - 1) - 1;
+    int mod = 1 << (BIT_VECTOR_SIZE - 1) - 1;
     long tempHash = a[0] * v + b[0];
     tempHash %= mod;
     int hash = (int) tempHash;
@@ -259,8 +266,8 @@ public class NumDistinctValueEstimator {
       int index;
 
       // Find the index of the least significant bit that is 1
-      for (index=0; index<bitVectorSize; index++) {
-        if (hash % 2 == 1) {
+      for (index=0; index<BIT_VECTOR_SIZE; index++) {
+        if (hash % 2 != 0) {
           break;
         }
         hash = hash >> 1;
@@ -277,8 +284,8 @@ public class NumDistinctValueEstimator {
     int index;
 
     // Find the index of the least significant bit that is 1
-    for (index=0; index<bitVectorSize; index++) {
-      if (rho % 2 == 1) {
+    for (index=0; index<BIT_VECTOR_SIZE; index++) {
+      if (rho % 2 != 0) {
         break;
       }
       rho = rho >> 1;
@@ -321,13 +328,13 @@ public class NumDistinctValueEstimator {
 
     for (int i=0; i < numBitVectors; i++) {
       int index = 0;
-      while (bitVector[i].get(index) && index < bitVectorSize) {
+      while (bitVector[i].get(index) && index < BIT_VECTOR_SIZE) {
         index = index + 1;
       }
       S = S + index;
     }
 
-    numDistinctValues = ((numBitVectors/phi) * Math.pow(2.0, S/numBitVectors));
+    numDistinctValues = ((numBitVectors/PHI) * Math.pow(2.0, S/numBitVectors));
     return ((long)numDistinctValues);
   }
 
@@ -345,7 +352,7 @@ public class NumDistinctValueEstimator {
     }
 
     avgLeastSigZero =
-        (double)(sumLeastSigZero/(numBitVectors * 1.0)) - (Math.log(phi)/Math.log(2.0));
+        (double)(sumLeastSigZero/(numBitVectors * 1.0)) - (Math.log(PHI)/Math.log(2.0));
     numDistinctValues = Math.pow(2.0, avgLeastSigZero);
     return ((long)(numDistinctValues));
   }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/MatchPath.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/MatchPath.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/MatchPath.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/MatchPath.java Wed Feb 18 22:28:35 2015
@@ -28,6 +28,7 @@ import org.apache.hadoop.hive.ql.exec.Ex
 import org.apache.hadoop.hive.ql.exec.ExprNodeEvaluatorFactory;
 import org.apache.hadoop.hive.ql.exec.PTFPartition;
 import org.apache.hadoop.hive.ql.exec.PTFPartition.PTFPartitionIterator;
+import org.apache.hadoop.hive.ql.exec.Utilities;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.parse.ASTNode;
 import org.apache.hadoop.hive.ql.parse.PTFTranslator;
@@ -195,6 +196,20 @@ public class MatchPath extends TableFunc
 
       setOutputOI(OI);
     }
+
+    @Override
+    public List<String> getReferencedColumns() throws SemanticException {
+      MatchPath matchPath = (MatchPath) evaluator;
+      List<String> columns = new ArrayList<>();
+      for (ExprNodeDesc exprNode : matchPath.resultExprInfo.resultExprNodes) {
+        Utilities.mergeUniqElems(columns, exprNode.getCols());
+      }
+      for (ExprNodeDesc exprNode : matchPath.symInfo.symbolExprsDecs) {
+        Utilities.mergeUniqElems(columns, exprNode.getCols());
+      }
+      return columns;
+    }
+    
     /*
      * validate and setup patternStr
      */
@@ -356,6 +371,7 @@ public class MatchPath extends TableFunc
 
   static class SymbolsInfo {
     int sz;
+    ArrayList<ExprNodeDesc> symbolExprsDecs;
     ArrayList<ExprNodeEvaluator> symbolExprsEvaluators;
     ArrayList<ObjectInspector> symbolExprsOIs;
     ArrayList<String> symbolExprsNames;
@@ -366,6 +382,7 @@ public class MatchPath extends TableFunc
       symbolExprsEvaluators = new ArrayList<ExprNodeEvaluator>(sz);
       symbolExprsOIs = new ArrayList<ObjectInspector>(sz);
       symbolExprsNames = new ArrayList<String>(sz);
+      symbolExprsDecs = new ArrayList<>(sz);
     }
 
     void add(String name, PTFExpressionDef arg)
@@ -373,6 +390,7 @@ public class MatchPath extends TableFunc
       symbolExprsNames.add(name);
       symbolExprsEvaluators.add(arg.getExprEvaluator());
       symbolExprsOIs.add(arg.getOI());
+      symbolExprsDecs.add(arg.getExprNode());
     }
   }
 
@@ -749,8 +767,7 @@ public class MatchPath extends TableFunc
       /*
        * create SelectListOI
        */
-      selectListInputOI = (StructObjectInspector)
-          PTFTranslator.getStandardStructOI(selectListInputRowResolver);
+      selectListInputOI = PTFTranslator.getStandardStructOI(selectListInputRowResolver);
     }
 
     private void fixResultExprString()

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NoopWithMap.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NoopWithMap.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NoopWithMap.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NoopWithMap.java Wed Feb 18 22:28:35 2015
@@ -29,11 +29,6 @@ import org.apache.hadoop.hive.serde2.obj
 
 public class NoopWithMap extends Noop
 {
-  @Override
-  public PTFPartition execute(PTFPartition iPart) throws HiveException
-  {
-    return iPart;
-  }
 
   @Override
   protected PTFPartition _transformRawInput(PTFPartition iPart) throws HiveException

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionEvaluator.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionEvaluator.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionEvaluator.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionEvaluator.java Wed Feb 18 22:28:35 2015
@@ -30,7 +30,6 @@ import org.apache.hadoop.hive.ql.metadat
 import org.apache.hadoop.hive.ql.plan.PTFDesc;
 import org.apache.hadoop.hive.ql.plan.ptf.PartitionedTableFunctionDef;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator;
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
 
 /*
@@ -60,7 +59,7 @@ import org.apache.hadoop.hive.serde2.obj
  */
 
 /**
- * Based on Hive {@link GenericUDAFEvaluator}. Break up the responsibility of the old AsbtractTableFunction
+ * Based on Hive {@link GenericUDAFEvaluator}. Break up the responsibility of the old AbstractTableFunction
  * class into a Resolver and Evaluator.
  * <p>
  * The Evaluator also holds onto the {@link TableFunctionDef}. This provides information
@@ -79,7 +78,7 @@ import org.apache.hadoop.hive.serde2.obj
  */
 public abstract class TableFunctionEvaluator {
   /*
-   * how is this different from the OutpuShape set on the TableDef.
+   * how is this different from the OutputShape set on the TableDef.
    * This is the OI of the object coming out of the PTF.
    * It is put in an output Partition whose Serde is usually LazyBinarySerde.
    * So the next PTF (or Operator) in the chain gets a LazyBinaryStruct.

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionResolver.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionResolver.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionResolver.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionResolver.java Wed Feb 18 22:28:35 2015
@@ -60,7 +60,7 @@ public abstract class TableFunctionResol
   /*
    * - called during translation.
    * - invokes createEvaluator which must be implemented by a subclass
-   * - sets up the evaluator with references to the TableDef, PartitionClass, PartitonMemsize and
+   * - sets up the evaluator with references to the TableDef, PartitionClass, PartitionMemsize and
    *   the transformsRawInput boolean.
    */
   public void initialize(HiveConf cfg, PTFDesc ptfDesc, PartitionedTableFunctionDef tDef)
@@ -193,4 +193,14 @@ public abstract class TableFunctionResol
    * a subclass must provide the {@link TableFunctionEvaluator} instance.
    */
   protected abstract TableFunctionEvaluator createEvaluator(PTFDesc ptfDesc, PartitionedTableFunctionDef tDef);
+
+  /**
+   * Provide referenced columns names to be used in partition function
+   *
+   * @return null for unknown (will get all columns from table including virtual columns) 
+   * @throws SemanticException
+   */
+  public List<String> getReferencedColumns() throws SemanticException {
+    return null;
+  }
 }

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java Wed Feb 18 22:28:35 2015
@@ -69,8 +69,7 @@ public class WindowingTableFunction exte
   public void execute(PTFPartitionIterator<Object> pItr, PTFPartition outP) throws HiveException {
     ArrayList<List<?>> oColumns = new ArrayList<List<?>>();
     PTFPartition iPart = pItr.getPartition();
-    StructObjectInspector inputOI;
-    inputOI = (StructObjectInspector) iPart.getOutputOI();
+    StructObjectInspector inputOI = iPart.getOutputOI();
 
     WindowTableFunctionDef wTFnDef = (WindowTableFunctionDef) getTableDef();
     Order order = wTFnDef.getOrder().getExpressions().get(0).getOrder();
@@ -145,7 +144,8 @@ public class WindowingTableFunction exte
     return true;
   }
 
-  private boolean streamingPossible(Configuration cfg, WindowFunctionDef wFnDef) {
+  private boolean streamingPossible(Configuration cfg, WindowFunctionDef wFnDef)
+      throws HiveException {
     WindowFrameDef wdwFrame = wFnDef.getWindowFrame();
     WindowFunctionInfo wFnInfo = FunctionRegistry.getWindowFunctionInfo(wFnDef
         .getName());
@@ -202,7 +202,7 @@ public class WindowingTableFunction exte
    * So no Unbounded Preceding or Following.
    */
   @SuppressWarnings("resource")
-  private int[] setCanAcceptInputAsStream(Configuration cfg) {
+  private int[] setCanAcceptInputAsStream(Configuration cfg) throws HiveException {
 
     canAcceptInputAsStream = false;
 
@@ -514,7 +514,6 @@ public class WindowingTableFunction exte
       i++;
     }
 
-    i=0;
     for(i=0; i < iPart.getOutputOI().getAllStructFieldRefs().size(); i++) {
       output.add(null);
     }

Modified: hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/TestHiveKVResultCache.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/TestHiveKVResultCache.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/TestHiveKVResultCache.java (original)
+++ hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/TestHiveKVResultCache.java Wed Feb 18 22:28:35 2015
@@ -27,8 +27,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.ql.io.HiveKey;
 import org.apache.hadoop.io.BytesWritable;
 import org.junit.Test;
@@ -42,8 +40,7 @@ public class TestHiveKVResultCache {
   @Test
   public void testSimple() throws Exception {
     // Create KV result cache object, add one (k,v) pair and retrieve them.
-    HiveConf conf = new HiveConf();
-    HiveKVResultCache cache = new HiveKVResultCache(conf);
+    HiveKVResultCache cache = new HiveKVResultCache();
 
     HiveKey key = new HiveKey("key".getBytes(), "key".hashCode());
     BytesWritable value = new BytesWritable("value".getBytes());
@@ -60,10 +57,9 @@ public class TestHiveKVResultCache {
 
   @Test
   public void testSpilling() throws Exception {
-    HiveConf conf = new HiveConf();
-    HiveKVResultCache cache = new HiveKVResultCache(conf);
+    HiveKVResultCache cache = new HiveKVResultCache();
 
-    final int recordCount = HiveKVResultCache.IN_MEMORY_CACHE_SIZE * 3;
+    final int recordCount = HiveKVResultCache.IN_MEMORY_NUM_ROWS * 3;
 
     // Test using the same cache where first n rows are inserted then cache is cleared.
     // Next reuse the same cache and insert another m rows and verify the cache stores correctly.
@@ -104,10 +100,18 @@ public class TestHiveKVResultCache {
   @Test
   public void testResultList() throws Exception {
     scanAndVerify(10000, 0, 0, "a", "b");
+    scanAndVerify(10000, 511, 0, "a", "b");
+    scanAndVerify(10000, 511 * 2, 0, "a", "b");
+    scanAndVerify(10000, 511, 10, "a", "b");
+    scanAndVerify(10000, 511 * 2, 10, "a", "b");
     scanAndVerify(10000, 512, 0, "a", "b");
     scanAndVerify(10000, 512 * 2, 0, "a", "b");
-    scanAndVerify(10000, 512, 10, "a", "b");
-    scanAndVerify(10000, 512 * 2, 10, "a", "b");
+    scanAndVerify(10000, 512, 3, "a", "b");
+    scanAndVerify(10000, 512 * 6, 10, "a", "b");
+    scanAndVerify(10000, 512 * 7, 5, "a", "b");
+    scanAndVerify(10000, 512 * 9, 19, "a", "b");
+    scanAndVerify(10000, 1, 0, "a", "b");
+    scanAndVerify(10000, 1, 1, "a", "b");
   }
 
   private static void scanAndVerify(
@@ -176,8 +180,8 @@ public class TestHiveKVResultCache {
     // A queue to notify separateRowGenerator to generate the next batch of rows.
     private LinkedBlockingQueue<Boolean> queue;
 
-    MyHiveFunctionResultList(Configuration conf, Iterator inputIterator) {
-      super(conf, inputIterator);
+    MyHiveFunctionResultList(Iterator inputIterator) {
+      super(inputIterator);
     }
 
     void init(long rows, int threshold, int separate, String p1, String p2) {
@@ -258,8 +262,7 @@ public class TestHiveKVResultCache {
   private static long scanResultList(long rows, int threshold, int separate,
       List<Tuple2<HiveKey, BytesWritable>> output, String prefix1, String prefix2) {
     final long iteratorCount = threshold == 0 ? 1 : rows * (100 - separate) / 100 / threshold;
-    MyHiveFunctionResultList resultList = new MyHiveFunctionResultList(
-        new HiveConf(), new Iterator() {
+    MyHiveFunctionResultList resultList = new MyHiveFunctionResultList(new Iterator() {
       // Input record iterator, not used
       private int i = 0;
       @Override

Modified: hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestIUD.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestIUD.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestIUD.java (original)
+++ hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestIUD.java Wed Feb 18 22:28:35 2015
@@ -207,6 +207,26 @@ public class TestIUD {
           "(TOK_WHERE (= (TOK_TABLE_OR_COL b) 9))))",
       ast.toStringTree());
   }
+  /**
+   * same as testInsertIntoTableAsSelectFromNamedVirtTable but with column list on target table
+   * @throws ParseException
+   */
+  @Test
+  public void testInsertIntoTableAsSelectFromNamedVirtTableNamedCol() throws ParseException {
+    ASTNode ast = parse("insert into page_view(c1,c2) select a,b as c from (values (1,2),(3,4)) as VC(a,b) where b = 9");
+    Assert.assertEquals("AST doesn't match",
+      "(TOK_QUERY " +
+        "(TOK_FROM " +
+        "(TOK_VIRTUAL_TABLE " +
+        "(TOK_VIRTUAL_TABREF (TOK_TABNAME VC) (TOK_COL_NAME a b)) " +
+        "(TOK_VALUES_TABLE (TOK_VALUE_ROW 1 2) (TOK_VALUE_ROW 3 4)))) " +
+        "(TOK_INSERT (TOK_INSERT_INTO (TOK_TAB (TOK_TABNAME page_view)) (TOK_TABCOLNAME c1 c2)) " +
+        "(TOK_SELECT " +
+        "(TOK_SELEXPR (TOK_TABLE_OR_COL a)) " +
+        "(TOK_SELEXPR (TOK_TABLE_OR_COL b) c)) " +
+        "(TOK_WHERE (= (TOK_TABLE_OR_COL b) 9))))",
+      ast.toStringTree());
+  }
   @Test
   public void testInsertIntoTableFromAnonymousTable1Row() throws ParseException {
     ASTNode ast = parse("insert into page_view values(1,2)");
@@ -220,6 +240,32 @@ public class TestIUD {
         "(TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF))))",
       ast.toStringTree());
   }
+  /**
+   * Same as testInsertIntoTableFromAnonymousTable1Row but with column list on target table
+   * @throws ParseException
+   */
+  @Test
+  public void testInsertIntoTableFromAnonymousTable1RowNamedCol() throws ParseException {
+    ASTNode ast = parse("insert into page_view(a,b) values(1,2)");
+    Assert.assertEquals("AST doesn't match",
+      "(TOK_QUERY " +
+        "(TOK_FROM " +
+          "(TOK_VIRTUAL_TABLE " +
+            "(TOK_VIRTUAL_TABREF TOK_ANONYMOUS) " +
+            "(TOK_VALUES_TABLE (TOK_VALUE_ROW 1 2))" +
+          ")" +
+        ") " +
+        "(TOK_INSERT " +
+          "(TOK_INSERT_INTO " +
+            "(TOK_TAB (TOK_TABNAME page_view)) " +
+            "(TOK_TABCOLNAME a b)" +//this is "extra" piece we get vs previous query
+          ") " +
+          "(TOK_SELECT " +
+            "(TOK_SELEXPR TOK_ALLCOLREF)" +
+          ")" +
+        ")" +
+      ")", ast.toStringTree());
+  }
   @Test
   public void testInsertIntoTableFromAnonymousTable() throws ParseException {
     ASTNode ast = parse("insert into table page_view values(-1,2),(3,+4)");

Modified: hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestMacroSemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestMacroSemanticAnalyzer.java?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestMacroSemanticAnalyzer.java (original)
+++ hive/branches/cbo/ql/src/test/org/apache/hadoop/hive/ql/parse/TestMacroSemanticAnalyzer.java Wed Feb 18 22:28:35 2015
@@ -66,12 +66,12 @@ public class TestMacroSemanticAnalyzer {
   @Test
   public void testDropMacroExistsDoNotIgnoreErrors() throws Exception {
     conf.setBoolVar(ConfVars.DROPIGNORESNONEXISTENT, false);
-    FunctionRegistry.registerGenericUDF(false, "SOME_MACRO", GenericUDFMacro.class);
+    FunctionRegistry.registerTemporaryUDF("SOME_MACRO", GenericUDFMacro.class);
     analyze(parse("DROP TEMPORARY MACRO SOME_MACRO"));
   }
   @Test
   public void testDropMacro() throws Exception {
-    FunctionRegistry.registerGenericUDF(false, "SOME_MACRO", GenericUDFMacro.class);
+    FunctionRegistry.registerTemporaryUDF("SOME_MACRO", GenericUDFMacro.class);
     analyze(parse("DROP TEMPORARY MACRO SOME_MACRO"));
   }
   @Test(expected = SemanticException.class)

Modified: hive/branches/cbo/ql/src/test/queries/clientnegative/drop_native_udf.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientnegative/drop_native_udf.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientnegative/drop_native_udf.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientnegative/drop_native_udf.q Wed Feb 18 22:28:35 2015
@@ -1 +1 @@
-DROP TEMPORARY FUNCTION max;
+DROP FUNCTION max;

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/groupby3_map_skew.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/groupby3_map_skew.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/groupby3_map_skew.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/groupby3_map_skew.q Wed Feb 18 22:28:35 2015
@@ -29,5 +29,6 @@ INSERT OVERWRITE TABLE dest1 SELECT
   variance(substr(src.value,5)),
   var_samp(substr(src.value,5));
 
-SELECT c1, c2, c3, c4, c5, c6, c7, ROUND(c8, 5), ROUND(c9, 5) FROM dest1;
+SELECT ROUND(c1, 1), ROUND(c2, 3), ROUND(c3, 5), ROUND(c4, 1), ROUND(c5, 1), ROUND(c6, 5),
+ROUND(c7,5), ROUND(c8, 5), ROUND(c9, 5) FROM dest1;
 

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/groupby7_noskew_multi_single_reducer.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/groupby7_noskew_multi_single_reducer.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/groupby7_noskew_multi_single_reducer.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/groupby7_noskew_multi_single_reducer.q Wed Feb 18 22:28:35 2015
@@ -12,8 +12,8 @@ SET hive.exec.compress.output=true;
 
 EXPLAIN
 FROM SRC
-INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key limit 10
-INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key limit 10;
+INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key ORDER BY SRC.key limit 10
+INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key ORDER BY SRC.key limit 10;
 
 FROM SRC
 INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key ORDER BY SRC.key limit 10

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/groupby_multi_single_reducer3.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/groupby_multi_single_reducer3.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/groupby_multi_single_reducer3.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/groupby_multi_single_reducer3.q Wed Feb 18 22:28:35 2015
@@ -1,4 +1,7 @@
 -- HIVE-3849 Aliased column in where clause for multi-groupby single reducer cannot be resolved
+
+-- SORT_QUERY_RESULTS
+
 create table e1 (key string, count int);
 create table e2 (key string, count int);
 

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/parallel_join0.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/parallel_join0.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/parallel_join0.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/parallel_join0.q Wed Feb 18 22:28:35 2015
@@ -1,6 +1,6 @@
 set mapreduce.job.reduces=4;
 
--- SORT_BEFORE_DIFF
+-- SORT_QUERY_RESULTS
 
 EXPLAIN
 SELECT src1.key as k1, src1.value as v1, 

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/parquet_types.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/parquet_types.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/parquet_types.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/parquet_types.q Wed Feb 18 22:28:35 2015
@@ -55,8 +55,8 @@ SELECT ctinyint,
   MAX(cint),
   MIN(csmallint),
   COUNT(cstring1),
-  AVG(cfloat),
-  STDDEV_POP(cdouble)
+  ROUND(AVG(cfloat), 5),
+  ROUND(STDDEV_POP(cdouble),5)
 FROM parquet_types
 GROUP BY ctinyint
 ORDER BY ctinyint

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/ptf_matchpath.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/ptf_matchpath.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/ptf_matchpath.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/ptf_matchpath.q Wed Feb 18 22:28:35 2015
@@ -15,6 +15,17 @@ LOAD DATA LOCAL INPATH '../../data/files
 -- SORT_QUERY_RESULTS
 
 -- 1. basic Matchpath test
+explain
+select origin_city_name, fl_num, year, month, day_of_month, sz, tpath 
+from matchpath(on 
+        flights_tiny 
+        distribute by fl_num 
+        sort by year, month, day_of_month  
+      arg1('LATE.LATE+'), 
+      arg2('LATE'), arg3(arr_delay > 15), 
+    arg4('origin_city_name, fl_num, year, month, day_of_month, size(tpath) as sz, tpath[0].day_of_month as tpath') 
+   );       
+
 select origin_city_name, fl_num, year, month, day_of_month, sz, tpath 
 from matchpath(on 
         flights_tiny 
@@ -26,6 +37,17 @@ from matchpath(on
    );       
 
 -- 2. Matchpath on 1 partition
+explain
+select origin_city_name, fl_num, year, month, day_of_month, sz, tpath 
+from matchpath(on 
+        flights_tiny 
+        sort by fl_num, year, month, day_of_month  
+      arg1('LATE.LATE+'), 
+      arg2('LATE'), arg3(arr_delay > 15), 
+    arg4('origin_city_name, fl_num, year, month, day_of_month, size(tpath) as sz, tpath[0].day_of_month as tpath') 
+   )
+where fl_num = 1142;
+
 select origin_city_name, fl_num, year, month, day_of_month, sz, tpath 
 from matchpath(on 
         flights_tiny 
@@ -37,6 +59,17 @@ from matchpath(on
 where fl_num = 1142;
 
 -- 3. empty partition.
+explain
+select origin_city_name, fl_num, year, month, day_of_month, sz, tpath
+from matchpath(on
+        (select * from flights_tiny where fl_num = -1142) flights_tiny
+        sort by fl_num, year, month, day_of_month
+      arg1('LATE.LATE+'),
+      arg2('LATE'), arg3(arr_delay > 15),
+    arg4('origin_city_name, fl_num, year, month, day_of_month, size(tpath) as sz, tpath[0].day_of_month as tpath')
+   );
+   
+
 select origin_city_name, fl_num, year, month, day_of_month, sz, tpath
 from matchpath(on
         (select * from flights_tiny where fl_num = -1142) flights_tiny

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_pop.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_pop.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_pop.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_pop.q Wed Feb 18 22:28:35 2015
@@ -11,6 +11,6 @@ SELECT covar_pop(b, c) FROM covar_tab WH
 SELECT covar_pop(b, c) FROM covar_tab WHERE a < 3;
 SELECT covar_pop(b, c) FROM covar_tab WHERE a = 3;
 SELECT a, covar_pop(b, c) FROM covar_tab GROUP BY a ORDER BY a;
-SELECT covar_pop(b, c) FROM covar_tab;
+SELECT ROUND(covar_pop(b, c), 5) FROM covar_tab;
 
 DROP TABLE covar_tab;

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_samp.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_samp.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_samp.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/udaf_covar_samp.q Wed Feb 18 22:28:35 2015
@@ -11,6 +11,6 @@ SELECT covar_samp(b, c) FROM covar_tab W
 SELECT covar_samp(b, c) FROM covar_tab WHERE a < 3;
 SELECT covar_samp(b, c) FROM covar_tab WHERE a = 3;
 SELECT a, covar_samp(b, c) FROM covar_tab GROUP BY a ORDER BY a;
-SELECT covar_samp(b, c) FROM covar_tab;
+SELECT ROUND(covar_samp(b, c), 5) FROM covar_tab;
 
 DROP TABLE covar_tab;

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/union3.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/union3.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/union3.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/union3.q Wed Feb 18 22:28:35 2015
@@ -1,4 +1,4 @@
--- SORT_BEFORE_DIFF
+-- SORT_QUERY_RESULTS
 
 explain
 SELECT *

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/union4.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/union4.q?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/union4.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/union4.q Wed Feb 18 22:28:35 2015
@@ -1,5 +1,7 @@
 set hive.map.aggr = true;
 
+-- SORT_QUERY_RESULTS
+
 -- union case: both subqueries are map-reduce jobs on same input, followed by filesink
 
 

Modified: hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonexistent_class.q.out
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonexistent_class.q.out?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonexistent_class.q.out (original)
+++ hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonexistent_class.q.out Wed Feb 18 22:28:35 2015
@@ -2,5 +2,5 @@ PREHOOK: query: create function default.
 PREHOOK: type: CREATEFUNCTION
 PREHOOK: Output: database:default
 PREHOOK: Output: default.badfunc
-FAILED: Class my.nonexistent.class not found
+Failed to register default.badfunc using class my.nonexistent.class
 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask

Modified: hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonudf_class.q.out
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonudf_class.q.out?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonudf_class.q.out (original)
+++ hive/branches/cbo/ql/src/test/results/clientnegative/create_function_nonudf_class.q.out Wed Feb 18 22:28:35 2015
@@ -2,5 +2,5 @@ PREHOOK: query: create function default.
 PREHOOK: type: CREATEFUNCTION
 PREHOOK: Output: database:default
 PREHOOK: Output: default.badfunc
-FAILED: Class java.lang.String does not implement UDF, GenericUDF, or UDAF
+Failed to register default.badfunc using class java.lang.String
 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask

Modified: hive/branches/cbo/ql/src/test/results/clientnegative/drop_native_udf.q.out
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/results/clientnegative/drop_native_udf.q.out?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/results/clientnegative/drop_native_udf.q.out (original)
+++ hive/branches/cbo/ql/src/test/results/clientnegative/drop_native_udf.q.out Wed Feb 18 22:28:35 2015
@@ -1,4 +1 @@
-PREHOOK: query: DROP TEMPORARY FUNCTION max
-PREHOOK: type: DROPFUNCTION
-PREHOOK: Output: max
-FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask
+FAILED: SemanticException [Error 10301]: Cannot drop native function max

Modified: hive/branches/cbo/ql/src/test/results/clientnegative/udf_nonexistent_resource.q.out
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/results/clientnegative/udf_nonexistent_resource.q.out?rev=1660751&r1=1660750&r2=1660751&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/results/clientnegative/udf_nonexistent_resource.q.out (original)
+++ hive/branches/cbo/ql/src/test/results/clientnegative/udf_nonexistent_resource.q.out Wed Feb 18 22:28:35 2015
@@ -4,4 +4,5 @@ PREHOOK: Output: database:default
 PREHOOK: Output: default.lookup
 #### A masked pattern was here ####
 nonexistent_file.txt does not exist
-FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask. nonexistent_file.txt does not exist
+Failed to register default.lookup using class org.apache.hadoop.hive.ql.udf.UDFFileLookup
+FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask



Mime
View raw message