hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject svn commit: r1661271 [9/39] - in /hive/branches/llap: ./ 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-...
Date Sat, 21 Feb 2015 02:37:03 GMT
Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java Sat Feb 21 02:36:54 2015
@@ -216,7 +216,8 @@ public class WindowingSpec {
    * - A Window Specification with no Order and no Window Frame is interpreted as:
          ROW BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
    */
-  private void effectiveWindowFrame(WindowFunctionSpec wFn, WindowSpec wdwSpec) {
+  private void effectiveWindowFrame(WindowFunctionSpec wFn, WindowSpec wdwSpec)
+      throws SemanticException {
 
     WindowFunctionInfo wFnInfo = FunctionRegistry.getWindowFunctionInfo(wFn.getName());
     boolean supportsWindowing = wFnInfo == null ? true : wFnInfo.isSupportsWindow();

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/spark/GenSparkUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/spark/GenSparkUtils.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/spark/GenSparkUtils.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/parse/spark/GenSparkUtils.java Sat Feb 21 02:36:54 2015
@@ -189,7 +189,15 @@ public class GenSparkUtils {
     throws SemanticException {
 
     List<Operator<?>> roots = new ArrayList<Operator<?>>();
-    roots.addAll(work.getAllRootOperators());
+
+    // For MapWork, getAllRootOperators is not suitable, since it checks
+    // getPathToAliases, and will return null if this is empty. Here we are
+    // replacing getAliasToWork, so should use that information instead.
+    if (work instanceof MapWork) {
+      roots.addAll(((MapWork) work).getAliasToWork().values());
+    } else {
+      roots.addAll(work.getAllRootOperators());
+    }
     if (work.getDummyOps() != null) {
       roots.addAll(work.getDummyOps());
     }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java Sat Feb 21 02:36:54 2015
@@ -31,7 +31,7 @@ public class FilterDesc extends Abstract
   /**
    * sampleDesc is used to keep track of the sampling descriptor.
    */
-  public static class sampleDesc implements Cloneable {
+  public static class SampleDesc implements Cloneable {
     // The numerator of the TABLESAMPLE clause
     private int numerator;
 
@@ -41,11 +41,11 @@ public class FilterDesc extends Abstract
     // Input files can be pruned
     private boolean inputPruning;
 
-    public sampleDesc() {
+    public SampleDesc() {
     }
 
-    public sampleDesc(int numerator, int denominator,
-        List<String> tabBucketCols, boolean inputPruning) {
+    public SampleDesc(int numerator, int denominator,
+                      List<String> tabBucketCols, boolean inputPruning) {
       this.numerator = numerator;
       this.denominator = denominator;
       this.inputPruning = inputPruning;
@@ -65,15 +65,19 @@ public class FilterDesc extends Abstract
 
     @Override
     public Object clone() {
-      sampleDesc desc = new sampleDesc(numerator, denominator, null, inputPruning);
+      SampleDesc desc = new SampleDesc(numerator, denominator, null, inputPruning);
       return desc;
     }
+    
+    public String toString() {
+      return inputPruning ? "BUCKET " + numerator + " OUT OF " + denominator: null;  
+    }
   }
 
   private static final long serialVersionUID = 1L;
   private org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate;
   private boolean isSamplingPred;
-  private transient sampleDesc sampleDescr;
+  private transient SampleDesc sampleDescr;
   //Is this a filter that should perform a comparison for sorted searches
   private boolean isSortedFilter;
 
@@ -90,7 +94,7 @@ public class FilterDesc extends Abstract
 
   public FilterDesc(
       final org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate,
-      boolean isSamplingPred, final sampleDesc sampleDescr) {
+      boolean isSamplingPred, final SampleDesc sampleDescr) {
     this.predicate = predicate;
     this.isSamplingPred = isSamplingPred;
     this.sampleDescr = sampleDescr;
@@ -121,15 +125,19 @@ public class FilterDesc extends Abstract
     this.isSamplingPred = isSamplingPred;
   }
 
-  @Explain(displayName = "sampleDesc", normalExplain = false)
-  public sampleDesc getSampleDescr() {
+  public SampleDesc getSampleDescr() {
     return sampleDescr;
   }
 
-  public void setSampleDescr(final sampleDesc sampleDescr) {
+  public void setSampleDescr(final SampleDesc sampleDescr) {
     this.sampleDescr = sampleDescr;
   }
 
+  @Explain(displayName = "sampleDesc", normalExplain = false)
+  public String getSampleDescExpr() {
+    return sampleDescr == null ? null : sampleDescr.toString();
+  }
+
   public boolean isSortedFilter() {
     return isSortedFilter;
   }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FunctionWork.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FunctionWork.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FunctionWork.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/FunctionWork.java Sat Feb 21 02:36:54 2015
@@ -28,6 +28,7 @@ public class FunctionWork implements Ser
   private static final long serialVersionUID = 1L;
   private CreateFunctionDesc createFunctionDesc;
   private DropFunctionDesc dropFunctionDesc;
+  private ReloadFunctionDesc reloadFunctionDesc;
   private CreateMacroDesc createMacroDesc;
   private DropMacroDesc dropMacroDesc;
 
@@ -45,6 +46,10 @@ public class FunctionWork implements Ser
     this.dropFunctionDesc = dropFunctionDesc;
   }
 
+  public FunctionWork(ReloadFunctionDesc reloadFunctionDesc) {
+    this.reloadFunctionDesc = reloadFunctionDesc;
+  }
+
   public FunctionWork(CreateMacroDesc createMacroDesc) {
     this.createMacroDesc = createMacroDesc;
   }
@@ -69,6 +74,14 @@ public class FunctionWork implements Ser
     this.dropFunctionDesc = dropFunctionDesc;
   }
 
+  public ReloadFunctionDesc getReloadFunctionDesc() {
+    return reloadFunctionDesc;
+  }
+
+  public void setReloadFunctionDesc(ReloadFunctionDesc reloadFunctionDesc) {
+    this.reloadFunctionDesc = reloadFunctionDesc;
+  }
+
   public CreateMacroDesc getCreateMacroDesc() {
     return createMacroDesc;
   }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDesc.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDesc.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDesc.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDesc.java Sat Feb 21 02:36:54 2015
@@ -22,13 +22,16 @@ package org.apache.hadoop.hive.ql.plan;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.ql.exec.PTFUtils;
 import org.apache.hadoop.hive.ql.parse.LeadLagInfo;
-import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.Order;
-import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PTFQueryInputType;
+import org.apache.hadoop.hive.ql.plan.ptf.PTFInputDef;
 import org.apache.hadoop.hive.ql.plan.ptf.PartitionedTableFunctionDef;
 import org.apache.hadoop.hive.ql.plan.ptf.WindowTableFunctionDef;
+import org.apache.hadoop.hive.ql.udf.ptf.Noop;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 
 @Explain(displayName = "PTF Operator")
 public class PTFDesc extends AbstractOperatorDesc {
@@ -62,6 +65,19 @@ public class PTFDesc extends AbstractOpe
     return funcDef == null ? null : funcDef.getStartOfChain();
   }
 
+  @Explain(displayName = "Function definitions")
+  public List<PTFInputDef> getFuncDefExplain() {
+    if (funcDef == null) {
+      return null;
+    }
+    List<PTFInputDef> inputs = new ArrayList<PTFInputDef>();
+    for (PTFInputDef current = funcDef; current != null; current = current.getInput()) {
+      inputs.add(current);
+    }
+    Collections.reverse(inputs);
+    return inputs;
+  }
+
   public LeadLagInfo getLlInfo() {
     return llInfo;
   }
@@ -70,10 +86,23 @@ public class PTFDesc extends AbstractOpe
     this.llInfo = llInfo;
   }
 
+  @Explain(displayName = "Lead/Lag information")
+  public String getLlInfoExplain() {
+    if (llInfo != null && llInfo.getLeadLagExprs() != null) {
+      return PlanUtils.getExprListString(llInfo.getLeadLagExprs());
+    }
+    return null;
+  }
+
   public boolean forWindowing() {
-    return funcDef != null && (funcDef instanceof WindowTableFunctionDef);
+    return funcDef instanceof WindowTableFunctionDef;
+  }
+
+  public boolean forNoop() {
+    return funcDef.getTFunction() instanceof Noop;
   }
 
+  @Explain(displayName = "Map-side function", displayOnlyOnTrue = true)
   public boolean isMapSide() {
     return isMapSide;
   }
@@ -89,5 +118,4 @@ public class PTFDesc extends AbstractOpe
   public void setCfg(Configuration cfg) {
     this.cfg = cfg;
   }
-
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java Sat Feb 21 02:36:54 2015
@@ -62,6 +62,7 @@ import org.apache.hadoop.hive.serde2.Met
 import org.apache.hadoop.hive.serde2.binarysortable.BinarySortableSerDe;
 import org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe;
 import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe;
+import org.apache.hadoop.hive.serde2.lazy.LazySerDeParameters;
 import org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
@@ -287,7 +288,7 @@ public final class PlanUtils {
     tblDesc.getProperties().setProperty(serdeConstants.ESCAPE_CHAR, "\\");
     //enable extended nesting levels
     tblDesc.getProperties().setProperty(
-        LazySimpleSerDe.SERIALIZATION_EXTEND_NESTING_LEVELS, "true");
+    		LazySerDeParameters.SERIALIZATION_EXTEND_ADDITIONAL_NESTING_LEVELS, "true");
     return tblDesc;
   }
 
@@ -923,7 +924,7 @@ public final class PlanUtils {
     return null;
   }
 
-  public static String getExprListString(Collection<ExprNodeDesc> exprs) {
+  public static String getExprListString(Collection<?  extends ExprNodeDesc> exprs) {
     StringBuffer sb = new StringBuffer();
     boolean first = true;
     for (ExprNodeDesc expr: exprs) {

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/StatsNoJobWork.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/StatsNoJobWork.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/StatsNoJobWork.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/StatsNoJobWork.java Sat Feb 21 02:36:54 2015
@@ -21,6 +21,7 @@ package org.apache.hadoop.hive.ql.plan;
 import java.io.Serializable;
 
 import org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.tableSpec;
+import org.apache.hadoop.hive.ql.parse.PrunedPartitionList;
 
 /**
  * Client-side stats aggregator task.
@@ -31,6 +32,7 @@ public class StatsNoJobWork implements S
 
   private tableSpec tableSpecs;
   private boolean statsReliable;
+  private PrunedPartitionList prunedPartitionList;
 
   public StatsNoJobWork() {
   }
@@ -54,4 +56,12 @@ public class StatsNoJobWork implements S
   public void setStatsReliable(boolean statsReliable) {
     this.statsReliable = statsReliable;
   }
+
+  public void setPrunedPartitionList(PrunedPartitionList prunedPartitionList) {
+    this.prunedPartitionList = prunedPartitionList;
+  }
+
+  public PrunedPartitionList getPrunedPartitionList() {
+    return prunedPartitionList;
+  }
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/BoundaryDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/BoundaryDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/BoundaryDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/BoundaryDef.java Sat Feb 21 02:36:54 2015
@@ -32,4 +32,10 @@ public abstract class BoundaryDef {
   }
 
   public abstract int getAmt();
+
+  @Override
+  public String toString() {
+    return direction == null ? "" :
+        direction + "(" + (getAmt() == Integer.MAX_VALUE ? "MAX" : getAmt()) + ")";
+  }
 }
\ No newline at end of file

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFExpressionDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFExpressionDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFExpressionDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFExpressionDef.java Sat Feb 21 02:36:54 2015
@@ -20,6 +20,7 @@ package org.apache.hadoop.hive.ql.plan.p
 
 import org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator;
 import org.apache.hadoop.hive.ql.exec.PTFUtils;
+import org.apache.hadoop.hive.ql.plan.Explain;
 import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 
@@ -58,6 +59,11 @@ public class PTFExpressionDef {
     this.exprNode = exprNode;
   }
 
+  @Explain(displayName = "expr")
+  public String getExprNodeExplain() {
+    return exprNode == null ? null : exprNode.getExprString();
+  }
+
   public ExprNodeEvaluator getExprEvaluator() {
     return exprEvaluator;
   }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFInputDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFInputDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFInputDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFInputDef.java Sat Feb 21 02:36:54 2015
@@ -19,6 +19,10 @@
 package org.apache.hadoop.hive.ql.plan.ptf;
 
 
+import org.apache.hadoop.hive.ql.exec.RowSchema;
+import org.apache.hadoop.hive.ql.plan.Explain;
+import org.apache.hadoop.util.StringUtils;
+
 public abstract class PTFInputDef {
   private String expressionTreeString;
   private ShapeDetails outputShape;
@@ -36,9 +40,17 @@ public abstract class PTFInputDef {
     return outputShape;
   }
 
+  @Explain(displayName = "output shape")
+  public String getOutputShapeExplain() {
+    RowSchema schema = outputShape.getRr().getRowSchema();
+    return StringUtils.join(", ", schema.getSignature());
+  }
+
   public void setOutputShape(ShapeDetails outputShape) {
     this.outputShape = outputShape;
   }
+
+  @Explain(displayName = "input alias")
   public String getAlias() {
     return alias;
   }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFQueryInputDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFQueryInputDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFQueryInputDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PTFQueryInputDef.java Sat Feb 21 02:36:54 2015
@@ -19,11 +19,14 @@
 package org.apache.hadoop.hive.ql.plan.ptf;
 
 import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PTFQueryInputType;
+import org.apache.hadoop.hive.ql.plan.Explain;
 
+@Explain(displayName = "Input definition")
 public class PTFQueryInputDef extends PTFInputDef {
   private String destination;
   private PTFQueryInputType type;
 
+  @Explain(displayName = "destination")
   public String getDestination() {
     return destination;
   }
@@ -40,6 +43,11 @@ public class PTFQueryInputDef extends PT
     this.type = type;
   }
 
+  @Explain(displayName = "type")
+  public String getTypeExplain() {
+    return type.name();
+  }
+
   @Override
   public PTFInputDef getInput() {
     return null;

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PartitionedTableFunctionDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PartitionedTableFunctionDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PartitionedTableFunctionDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/PartitionedTableFunctionDef.java Sat Feb 21 02:36:54 2015
@@ -21,8 +21,11 @@ package org.apache.hadoop.hive.ql.plan.p
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec;
+import org.apache.hadoop.hive.ql.plan.Explain;
 import org.apache.hadoop.hive.ql.udf.ptf.TableFunctionEvaluator;
 
+@Explain(displayName = "Partition table definition")
 public class PartitionedTableFunctionDef extends PTFInputDef {
   private String name;
   private String resolverClassName;
@@ -34,7 +37,10 @@ public class PartitionedTableFunctionDef
   private OrderDef order;
   private TableFunctionEvaluator tFunction;
   boolean transformsRawInput;
+  
+  private transient List<String> referencedColumns;
 
+  @Explain(displayName = "name")
   public String getName() {
     return name;
   }
@@ -47,6 +53,11 @@ public class PartitionedTableFunctionDef
     return rawInputShape;
   }
 
+  @Explain(displayName = "raw input shape")
+  public ShapeDetails getRawInputShapeExplain() {
+    return rawInputShape;
+  }
+
   public void setRawInputShape(ShapeDetails rawInputShape) {
     this.rawInputShape = rawInputShape;
   }
@@ -72,6 +83,21 @@ public class PartitionedTableFunctionDef
     return partition;
   }
 
+  @Explain(displayName = "partition by")
+  public String getPartitionExplain() {
+    if (partition == null || partition.getExpressions() == null) {
+      return null;
+    }
+    StringBuilder builder = new StringBuilder();
+    for (PTFExpressionDef expression : partition.getExpressions()) {
+      if (builder.length() > 0) {
+        builder.append(", ");
+      }
+      builder.append(expression.getExprNode().getExprString());
+    }
+    return builder.toString();
+  }
+
   public void setPartition(PartitionDef partition) {
     this.partition = partition;
   }
@@ -84,9 +110,28 @@ public class PartitionedTableFunctionDef
     this.order = order;
   }
 
+  @Explain(displayName = "order by")
+  public String getOrderExplain() {
+    if (order == null || order.getExpressions() == null) {
+      return null;
+    }
+    StringBuilder builder = new StringBuilder();
+    for (OrderExpressionDef expression : order.getExpressions()) {
+      if (builder.length() > 0) {
+        builder.append(", ");
+      }
+      builder.append(expression.getExprNode().getExprString());
+      if (expression.getOrder() == PTFInvocationSpec.Order.DESC) {
+        builder.append("(DESC)");
+      }
+    }
+    return builder.toString();
+  }
+
   public TableFunctionEvaluator getTFunction() {
     return tFunction;
   }
+
   public void setTFunction(TableFunctionEvaluator tFunction) {
     this.tFunction = tFunction;
   }
@@ -99,6 +144,21 @@ public class PartitionedTableFunctionDef
     this.args = args;
   }
 
+  @Explain(displayName = "arguments")
+  public String getArgsExplain() {
+    if (args == null) {
+      return null;
+    }
+    StringBuilder builder = new StringBuilder();
+    for (PTFExpressionDef expression : args) {
+      if (builder.length() > 0) {
+        builder.append(", ");
+      }
+      builder.append(expression.getExprNode().getExprString());
+    }
+    return builder.toString();
+  }
+
   public void addArg(PTFExpressionDef arg) {
     args = args == null ? new ArrayList<PTFExpressionDef>() : args;
     args.add(arg);
@@ -111,6 +171,7 @@ public class PartitionedTableFunctionDef
     return this;
   }
 
+  @Explain(displayName = "transforms raw input", displayOnlyOnTrue=true)
   public boolean isTransformsRawInput() {
     return transformsRawInput;
   }
@@ -126,4 +187,13 @@ public class PartitionedTableFunctionDef
   public void setResolverClassName(String resolverClassName) {
     this.resolverClassName = resolverClassName;
   }
+
+  @Explain(displayName = "referenced columns")
+  public List<String> getReferencedColumns() {
+    return referencedColumns;
+  }
+
+  public void setReferencedColumns(List<String> referencedColumns) {
+    this.referencedColumns = referencedColumns;
+  }
 }
\ No newline at end of file

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowExpressionDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowExpressionDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowExpressionDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowExpressionDef.java Sat Feb 21 02:36:54 2015
@@ -19,15 +19,12 @@
 package org.apache.hadoop.hive.ql.plan.ptf;
 
 
-public class WindowExpressionDef extends PTFExpressionDef {
-  private String alias;
-
-  public WindowExpressionDef() {}
+import org.apache.hadoop.hive.ql.plan.Explain;
 
-  public WindowExpressionDef(PTFExpressionDef eDef) {
-    super(eDef);
-  }
+public abstract class WindowExpressionDef extends PTFExpressionDef {
+  private String alias;
 
+  @Explain(displayName = "alias")
   public String getAlias() {
     return alias;
   }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFrameDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFrameDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFrameDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFrameDef.java Sat Feb 21 02:36:54 2015
@@ -38,4 +38,9 @@ public class WindowFrameDef {
   public void setEnd(BoundaryDef end) {
     this.end = end;
   }
+
+  @Override
+  public String toString() {
+    return start + "~" + end;
+  }
 }
\ No newline at end of file

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFunctionDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFunctionDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFunctionDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowFunctionDef.java Sat Feb 21 02:36:54 2015
@@ -21,8 +21,10 @@ package org.apache.hadoop.hive.ql.plan.p
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.hadoop.hive.ql.plan.Explain;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator;
 
+@Explain(displayName = "window function definition")
 public class WindowFunctionDef extends WindowExpressionDef {
   String name;
   boolean isStar;
@@ -32,6 +34,7 @@ public class WindowFunctionDef extends W
   GenericUDAFEvaluator wFnEval;
   boolean pivotResult;
 
+  @Explain(displayName = "name")
   public String getName() {
     return name;
   }
@@ -40,6 +43,7 @@ public class WindowFunctionDef extends W
     this.name = name;
   }
 
+  @Explain(displayName = "isStar", displayOnlyOnTrue = true)
   public boolean isStar() {
     return isStar;
   }
@@ -48,6 +52,7 @@ public class WindowFunctionDef extends W
     this.isStar = isStar;
   }
 
+  @Explain(displayName = "isDistinct", displayOnlyOnTrue = true)
   public boolean isDistinct() {
     return isDistinct;
   }
@@ -69,6 +74,21 @@ public class WindowFunctionDef extends W
     args.add(arg);
   }
 
+  @Explain(displayName = "arguments")
+  public String getArgsExplain() {
+    if (args == null) {
+      return null;
+    }
+    StringBuilder builder = new StringBuilder();
+    for (PTFExpressionDef expression : args) {
+      if (builder.length() > 0) {
+        builder.append(", ");
+      }
+      builder.append(expression.getExprNode().getExprString());
+    }
+    return builder.toString();
+  }
+
   public WindowFrameDef getWindowFrame() {
     return windowFrame;
   }
@@ -77,6 +97,11 @@ public class WindowFunctionDef extends W
     this.windowFrame = windowFrame;
   }
 
+  @Explain(displayName = "window frame")
+  public String getWindowFrameExplain() {
+    return windowFrame == null ? null : windowFrame.toString();
+  }
+
   public GenericUDAFEvaluator getWFnEval() {
     return wFnEval;
   }
@@ -85,6 +110,12 @@ public class WindowFunctionDef extends W
     this.wFnEval = wFnEval;
   }
 
+  @Explain(displayName = "window function")
+  public String getWFnEvalExplain() {
+    return wFnEval == null ? null : wFnEval.getClass().getSimpleName();
+  }
+
+  @Explain(displayName = "isPivotResult", displayOnlyOnTrue = true)
   public boolean isPivotResult() {
     return pivotResult;
   }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowTableFunctionDef.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowTableFunctionDef.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowTableFunctionDef.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/plan/ptf/WindowTableFunctionDef.java Sat Feb 21 02:36:54 2015
@@ -18,21 +18,26 @@
 
 package org.apache.hadoop.hive.ql.plan.ptf;
 
-import java.util.List;
+import org.apache.hadoop.hive.ql.plan.Explain;
 
+import java.util.List;
 
+@Explain(displayName = "Windowing table definition")
 public class WindowTableFunctionDef extends PartitionedTableFunctionDef {
   List<WindowFunctionDef> windowFunctions;
   
   int rankLimit = -1;
   int rankLimitFunction;
 
+  @Explain(displayName = "window functions")
   public List<WindowFunctionDef> getWindowFunctions() {
     return windowFunctions;
   }
+  
   public void setWindowFunctions(List<WindowFunctionDef> windowFunctions) {
     this.windowFunctions = windowFunctions;
   }
+
   public int getRankLimit() {
     return rankLimit;
   }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java Sat Feb 21 02:36:54 2015
@@ -28,6 +28,7 @@ import java.net.URLClassLoader;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -49,8 +50,8 @@ import org.apache.hadoop.hive.common.Jav
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
-import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.hive.ql.MapRedStats;
+import org.apache.hadoop.hive.ql.exec.Registry;
 import org.apache.hadoop.hive.ql.exec.Utilities;
 import org.apache.hadoop.hive.ql.exec.spark.session.SparkSession;
 import org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionManagerImpl;
@@ -261,6 +262,8 @@ public class SessionState {
    */
   private final Set<String> preReloadableAuxJars = new HashSet<String>();
 
+  private final Registry registry = new Registry();
+
   /**
    * CURRENT_TIMESTAMP value for query
    */
@@ -416,11 +419,33 @@ public class SessionState {
     return hdfsEncryptionShim;
   }
 
+  // SessionState is not available in runtime and Hive.get().getConf() is not safe to call
+  private static class SessionStates {
+    private SessionState state;
+    private HiveConf conf;
+    private void attach(SessionState state) {
+      this.state = state;
+      attach(state.getConf());
+    }
+    private void attach(HiveConf conf) {
+      this.conf = conf;
+      ClassLoader classLoader = conf.getClassLoader();
+      if (classLoader != null) {
+        Thread.currentThread().setContextClassLoader(classLoader);
+      }
+    }
+  }
+
   /**
    * Singleton Session object per thread.
    *
    **/
-  private static ThreadLocal<SessionState> tss = new ThreadLocal<SessionState>();
+  private static ThreadLocal<SessionStates> tss = new ThreadLocal<SessionStates>() {
+    @Override
+    protected SessionStates initialValue() {
+      return new SessionStates();
+    }
+  };
 
   /**
    * start a new session and set it to current session.
@@ -434,8 +459,7 @@ public class SessionState {
    * Sets the given session state in the thread local var for sessions.
    */
   public static void setCurrentSessionState(SessionState startSs) {
-    tss.set(startSs);
-    Thread.currentThread().setContextClassLoader(startSs.getConf().getClassLoader());
+    tss.get().attach(startSs);
   }
 
   public static void detachSession() {
@@ -702,9 +726,6 @@ public class SessionState {
     } catch (HiveException e) {
       LOG.error("Error setting up authorization: " + e.getMessage(), e);
       throw new RuntimeException(e);
-    } catch (MetaException e) {
-      LOG.error("Error setting up authorization: " + e.getMessage(), e);
-      throw new RuntimeException(e);
     }
 
     if(LOG.isDebugEnabled()){
@@ -714,7 +735,7 @@ public class SessionState {
     return;
   }
 
-  private void setAuthorizerV2Config() throws MetaException, HiveException {
+  private void setAuthorizerV2Config() throws HiveException {
     // avoid processing the same config multiple times, check marker
     if (conf.get(CONFIG_AUTHZ_SETTINGS_APPLIED_MARKER, "").equals(Boolean.TRUE.toString())) {
       return;
@@ -724,7 +745,13 @@ public class SessionState {
 
     authorizerV2.applyAuthorizationConfigPolicy(conf);
     // update config in Hive thread local as well and init the metastore client
-    Hive.get(conf).getMSC();
+    try {
+      Hive.get(conf).getMSC();
+    } catch (Exception e) {
+      // catch-all due to some exec time dependencies on session state
+      // that would cause ClassNoFoundException otherwise
+      throw new HiveException(e.getMessage(), e);
+    }
 
     // set a marker that this conf has been processed.
     conf.set(CONFIG_AUTHZ_SETTINGS_APPLIED_MARKER, Boolean.TRUE.toString());
@@ -781,11 +808,32 @@ public class SessionState {
    * get the current session.
    */
   public static SessionState get() {
-    return tss.get();
+    return tss.get().state;
+  }
+
+  public static HiveConf getSessionConf() {
+    SessionStates state = tss.get();
+    if (state.conf == null) {
+      state.attach(new HiveConf());
+    }
+    return state.conf;
+  }
+
+  public static Registry getRegistry() {
+    SessionState session = get();
+    return session != null ? session.registry : null;
+  }
+
+  public static Registry getRegistryForWrite() {
+    Registry registry = getRegistry();
+    if (registry == null) {
+      throw new RuntimeException("Function registery for session is not initialized");
+    }
+    return registry;
   }
 
   /**
-   * get hiveHitsory object which does structured logging.
+   * get hiveHistory object which does structured logging.
    *
    * @return The hive history object
    */
@@ -1080,13 +1128,13 @@ public class SessionState {
     return added.get(0);
   }
 
-  public List<String> add_resources(ResourceType t, List<String> values)
+  public List<String> add_resources(ResourceType t, Collection<String> values)
       throws RuntimeException {
     // By default don't convert to unix
     return add_resources(t, values, false);
   }
 
-  public List<String> add_resources(ResourceType t, List<String> values, boolean convertToUnix)
+  public List<String> add_resources(ResourceType t, Collection<String> values, boolean convertToUnix)
       throws RuntimeException {
     Set<String> resourceMap = getResourceMap(t);
 
@@ -1300,6 +1348,7 @@ public class SessionState {
   }
 
   public void close() throws IOException {
+    registry.clear();;
     if (txnMgr != null) txnMgr.closeTxnManager();
     JavaUtils.closeClassLoadersTo(conf.getClassLoader(), parentLoader);
     File resourceDir =
@@ -1388,9 +1437,8 @@ public class SessionState {
   /**
    * If authorization mode is v2, then pass it through authorizer so that it can apply
    * any security configuration changes.
-   * @throws MetaException
    */
-  public void applyAuthorizationPolicy() throws HiveException, MetaException {
+  public void applyAuthorizationPolicy() throws HiveException {
     setupAuth();
   }
 

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFEWAHBitmapBop.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFEWAHBitmapBop.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFEWAHBitmapBop.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFEWAHBitmapBop.java Sat Feb 21 02:36:54 2015
@@ -141,16 +141,6 @@ abstract public class AbstractGenericUDF
   
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append(name);
-    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(name, children, ",");
   }
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFReflect.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFReflect.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFReflect.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFReflect.java Sat Feb 21 02:36:54 2015
@@ -101,16 +101,7 @@ public abstract class AbstractGenericUDF
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append(functionName()).append('(');
-    for (int i = 0; i < children.length; i++) {
-      if (i > 0) {
-        sb.append(',');
-      }
-      sb.append(children[i]);
-    }
-    sb.append(')');
-    return sb.toString();
+    return getStandardDisplayString(functionName(), children, ",");
   }
 
   protected abstract String functionName();

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java Sat Feb 21 02:36:54 2015
@@ -210,4 +210,23 @@ public abstract class GenericUDF impleme
           + " and " + newInstance.getClass().getName());
     }
   }
+
+  protected String getStandardDisplayString(String name, String[] children) {
+    return getStandardDisplayString(name, children, ", ");
+  }
+
+  protected String getStandardDisplayString(String name, String[] children, String delim) {
+    StringBuilder sb = new StringBuilder();
+    sb.append(name);
+    sb.append("(");
+    if (children.length > 0) {
+      sb.append(children[0]);
+      for (int i = 1; i < children.length; i++) {
+        sb.append(delim);
+        sb.append(children[i]);
+      }
+    }
+    sb.append(")");
+    return sb.toString();
+  }
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAbs.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAbs.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAbs.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAbs.java Sat Feb 21 02:36:54 2015
@@ -150,17 +150,7 @@ public class GenericUDFAbs extends Gener
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("abs(");
-    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("abs", children);
   }
 
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAddMonths.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAddMonths.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAddMonths.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAddMonths.java Sat Feb 21 02:36:54 2015
@@ -73,11 +73,11 @@ public class GenericUDFAddMonths extends
     }
     if (arguments[0].getCategory() != ObjectInspector.Category.PRIMITIVE) {
       throw new UDFArgumentTypeException(0, "Only primitive type arguments are accepted but "
-          + arguments[0].getTypeName() + " is passed. as first arguments");
+          + arguments[0].getTypeName() + " is passed as first arguments");
     }
     if (arguments[1].getCategory() != ObjectInspector.Category.PRIMITIVE) {
       throw new UDFArgumentTypeException(1, "Only primitive type arguments are accepted but "
-          + arguments[2].getTypeName() + " is passed. as second arguments");
+          + arguments[1].getTypeName() + " is passed as second arguments");
     }
     inputType1 = ((PrimitiveObjectInspector) arguments[0]).getPrimitiveCategory();
     ObjectInspector outputOI = PrimitiveObjectInspectorFactory.writableStringObjectInspector;
@@ -100,14 +100,14 @@ public class GenericUDFAddMonths extends
           PrimitiveObjectInspectorFactory.writableDateObjectInspector);
       break;
     default:
-      throw new UDFArgumentException(
-          " ADD_MONTHS() only takes STRING/TIMESTAMP/DATEWRITABLE types as first argument, got "
+      throw new UDFArgumentTypeException(0,
+          "ADD_MONTHS() only takes STRING/TIMESTAMP/DATEWRITABLE types as first argument, got "
               + inputType1);
     }
     inputType2 = ((PrimitiveObjectInspector) arguments[1]).getPrimitiveCategory();
     if (inputType2 != PrimitiveCategory.INT) {
-      throw new UDFArgumentException(" ADD_MONTHS() only takes INT types as second argument, got "
-          + inputType2);
+      throw new UDFArgumentTypeException(1,
+          "ADD_MONTHS() only takes INT types as second argument, got " + inputType2);
     }
     intWritableConverter = ObjectInspectorConverters.getConverter(
         (PrimitiveObjectInspector) arguments[1],
@@ -144,7 +144,7 @@ public class GenericUDFAddMonths extends
       date = dw.get();
       break;
     default:
-      throw new UDFArgumentException(
+      throw new UDFArgumentTypeException(0,
           "ADD_MONTHS() only takes STRING/TIMESTAMP/DATEWRITABLE types, got " + inputType1);
     }
     int numMonth = toBeAdded.get();
@@ -156,17 +156,7 @@ public class GenericUDFAddMonths extends
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("add_months(");
-    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("add_months", children);
   }
 
   protected Calendar addMonth(Date d, int numMonths) {

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArray.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArray.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArray.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArray.java Sat Feb 21 02:36:54 2015
@@ -80,15 +80,6 @@ public class GenericUDFArray extends Gen
 
   @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("array(");
-    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("array", children, ",");
   }
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAssertTrue.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAssertTrue.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAssertTrue.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAssertTrue.java Sat Feb 21 02:36:54 2015
@@ -75,15 +75,6 @@ public class GenericUDFAssertTrue extend
 
  @Override
   public String getDisplayString(String[] children) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("assert_true(");
-    for (int i = 0; i < children.length; ++i) {
-      sb.append(children[i]);
-      if (i != children.length - 1) {
-        sb.append(", ");
-      }
-    }
-    sb.append(")");
-    return sb.toString();
+    return getStandardDisplayString("assert_true", children);
   }  
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java Sat Feb 21 02:36:54 2015
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hadoop.hive.common.type.HiveDecimal;
-import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.FunctionRegistry;
 import org.apache.hadoop.hive.ql.exec.NoMatchingMethodException;

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBasePad.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCoalesce.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java Sat Feb 21 02:36:54 2015
@@ -89,7 +89,7 @@ public class GenericUDFDateAdd extends G
     if (arguments[1].getCategory() != ObjectInspector.Category.PRIMITIVE) {
       throw new UDFArgumentTypeException(1,
         "Only primitive type arguments are accepted but "
-        + arguments[2].getTypeName() + " is passed. as second arguments");
+        + arguments[1].getTypeName() + " is passed. as second arguments");
     }
 
     inputType1 = ((PrimitiveObjectInspector) arguments[0]).getPrimitiveCategory();
@@ -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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java Sat Feb 21 02:36:54 2015
@@ -89,7 +89,7 @@ public class GenericUDFDateSub extends G
     if (arguments[1].getCategory() != ObjectInspector.Category.PRIMITIVE) {
       throw new UDFArgumentTypeException(1,
           "Only primitive type arguments are accepted but "
-              + arguments[2].getTypeName() + " is passed. as second arguments");
+              + arguments[1].getTypeName() + " is passed. as second arguments");
     }
 
     inputType1 = ((PrimitiveObjectInspector) arguments[0]).getPrimitiveCategory();
@@ -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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDecode.java Sat Feb 21 02:36:54 2015
@@ -38,8 +38,8 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.StringObjectInspector;
-import org.apache.hadoop.io.Text;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveGrouping;
 
 @Description(name = "decode",
     value = "_FUNC_(bin, str) - Decode the first argument using the second argument character set",
@@ -47,35 +47,42 @@ import org.apache.hadoop.io.Text;
         "'UTF-8', 'UTF-16BE', 'UTF-16LE', and 'UTF-16'. If either argument\n" +
         "is null, the result will also be null")
 public class GenericUDFDecode extends GenericUDF {
-  private transient CharsetDecoder decoder = null;
-  private transient BinaryObjectInspector bytesOI = null;
-  private transient StringObjectInspector charsetOI = null;
+  private transient CharsetDecoder decoder;
+  private transient BinaryObjectInspector bytesOI;
+  private transient PrimitiveObjectInspector charsetOI;
 
   @Override
   public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
     if (arguments.length != 2) {
-      throw new UDFArgumentLengthException("Encode() requires exactly two arguments");
+      throw new UDFArgumentLengthException("Decode() requires exactly two arguments");
     }
 
     if (arguments[0].getCategory() != Category.PRIMITIVE ||
         ((PrimitiveObjectInspector)arguments[0]).getPrimitiveCategory() != PrimitiveCategory.BINARY){
-      throw new UDFArgumentTypeException(0, "The first argument to Encode() must be a binary");
+      throw new UDFArgumentTypeException(0, "The first argument to Decode() must be a binary");
     }
 
     bytesOI = (BinaryObjectInspector) arguments[0];
 
-    if (arguments[1].getCategory() != Category.PRIMITIVE ||
-        ((PrimitiveObjectInspector)arguments[1]).getPrimitiveCategory() != PrimitiveCategory.STRING){
-      throw new UDFArgumentTypeException(1, "The second argument to Encode() must be a string");
+    if (arguments[1].getCategory() != Category.PRIMITIVE) {
+      throw new UDFArgumentTypeException(1, "The second argument to Decode() must be primitive");
     }
 
-    charsetOI = (StringObjectInspector) arguments[1];
-
-    // If the character set for encoding is constant, we can optimize that
-    StringObjectInspector charSetOI = (StringObjectInspector) arguments[1];
-    if (charSetOI instanceof ConstantObjectInspector){
-      String charSetName = ((Text) ((ConstantObjectInspector) charSetOI).getWritableConstantValue()).toString();
-      decoder = Charset.forName(charSetName).newDecoder().onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT);
+    charsetOI = (PrimitiveObjectInspector) arguments[1];
+
+    if (PrimitiveGrouping.STRING_GROUP != PrimitiveObjectInspectorUtils
+        .getPrimitiveGrouping(charsetOI.getPrimitiveCategory())) {
+      throw new UDFArgumentTypeException(1,
+          "The second argument to Decode() must be from string group");
+    }
+
+    // If the character set for decoding is constant, we can optimize that
+    if (arguments[1] instanceof ConstantObjectInspector) {
+      String charSetName = ((ConstantObjectInspector) arguments[1]).getWritableConstantValue()
+          .toString();
+      decoder = Charset.forName(charSetName).newDecoder()
+          .onMalformedInput(CodingErrorAction.REPORT)
+          .onUnmappableCharacter(CodingErrorAction.REPORT);
     }
 
     return (ObjectInspector) PrimitiveObjectInspectorFactory.javaStringObjectInspector;
@@ -97,7 +104,8 @@ public class GenericUDFDecode extends Ge
         throw new HiveException(e);
       }
     } else {
-      decoded = Charset.forName(charsetOI.getPrimitiveJavaObject(arguments[1].get())).decode(wrappedBytes);
+      String charSetName = PrimitiveObjectInspectorUtils.getString(arguments[1].get(), charsetOI);
+      decoded = Charset.forName(charSetName).decode(wrappedBytes);
     }
     return decoded.toString();
   }
@@ -105,10 +113,6 @@ public class GenericUDFDecode 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("decode", children, ",");
   }
 }

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEWAHBitmapEmpty.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFElt.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFEncode.java Sat Feb 21 02:36:54 2015
@@ -35,13 +35,10 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
 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.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveGrouping;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.StringObjectInspector;
 import org.apache.hadoop.io.BytesWritable;
-import org.apache.hadoop.io.Text;
 
 @Description(name = "encode",
 value = "_FUNC_(str, str) - Encode the first argument using the second argument character set",
@@ -116,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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFField.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFloorCeilBase.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFormatNumber.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGreatest.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFIf.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInitCap.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInstr.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java Sat Feb 21 02:36:54 2015
@@ -68,7 +68,7 @@ public class GenericUDFLastDay extends G
     }
     if (arguments[0].getCategory() != ObjectInspector.Category.PRIMITIVE) {
       throw new UDFArgumentTypeException(0, "Only primitive type arguments are accepted but "
-          + arguments[0].getTypeName() + " is passed. as first arguments");
+          + arguments[0].getTypeName() + " is passed");
     }
     inputType1 = ((PrimitiveObjectInspector) arguments[0]).getPrimitiveCategory();
     ObjectInspector outputOI = PrimitiveObjectInspectorFactory.writableStringObjectInspector;
@@ -91,9 +91,8 @@ public class GenericUDFLastDay extends G
           PrimitiveObjectInspectorFactory.writableDateObjectInspector);
       break;
     default:
-      throw new UDFArgumentException(
-          " LAST_DAY() only takes STRING/TIMESTAMP/DATEWRITABLE types as first argument, got "
-              + inputType1);
+      throw new UDFArgumentTypeException(0,
+          "LAST_DAY() only takes STRING/TIMESTAMP/DATEWRITABLE types, got " + inputType1);
     }
     return outputOI;
   }
@@ -112,23 +111,21 @@ public class GenericUDFLastDay extends G
       } catch (ParseException e) {
         return null;
       }
-      lastDay(date);
       break;
     case TIMESTAMP:
       Timestamp ts = ((TimestampWritable) timestampConverter.convert(arguments[0].get()))
           .getTimestamp();
       date = ts;
-      lastDay(date);
       break;
     case DATE:
       DateWritable dw = (DateWritable) dateWritableConverter.convert(arguments[0].get());
       date = dw.get();
-      lastDay(date);
       break;
     default:
-      throw new UDFArgumentException(
+      throw new UDFArgumentTypeException(0,
           "LAST_DAY() only takes STRING/TIMESTAMP/DATEWRITABLE types, got " + inputType1);
     }
+    lastDay(date);
     Date newDate = calendar.getTime();
     output.set(formatter.format(newDate));
     return output;
@@ -136,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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLocate.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLower.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMacro.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapKeys.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMapValues.java Sat Feb 21 02:36:54 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/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java?rev=1661271&r1=1661270&r2=1661271&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java Sat Feb 21 02:36:54 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, ",");
   }
 }



Mime
View raw message