You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by cw...@apache.org on 2011/08/16 23:00:08 UTC

svn commit: r1158446 - in /hive/trunk: ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/java/org/apache/hadoop/hive/ql/plan/ ql/src/java/org/apache/hadoop/hive/ql/udf/generic/ ql/src/test/queries/clientpositive/ ql/src/test/results/clientpositive/ se...

Author: cws
Date: Tue Aug 16 21:00:07 2011
New Revision: 1158446

URL: http://svn.apache.org/viewvc?rev=1158446&view=rev
Log:
HIVE-1360. Allow UDFs to access constant parameter values at compile time (Jonathan Chang via cws)

Added:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java   (with props)
    hive/trunk/ql/src/test/queries/clientpositive/udf_named_struct.q
    hive/trunk/ql/src/test/results/clientpositive/udf_named_struct.q.out
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ConstantObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantBooleanObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantDoubleObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantFloatObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantIntObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantLongObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantShortObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantStringObjectInspector.java   (with props)
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantVoidObjectInspector.java   (with props)
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeConstantEvaluator.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeConstantDesc.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDesc.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
    hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeConstantEvaluator.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeConstantEvaluator.java?rev=1158446&r1=1158445&r2=1158446&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeConstantEvaluator.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeConstantEvaluator.java Tue Aug 16 21:00:07 2011
@@ -20,10 +20,8 @@ package org.apache.hadoop.hive.ql.exec;
 
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc;
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
-import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
 
 /**
  * ExprNodeConstantEvaluator.
@@ -32,19 +30,11 @@ import org.apache.hadoop.hive.serde2.typ
 public class ExprNodeConstantEvaluator extends ExprNodeEvaluator {
 
   protected ExprNodeConstantDesc expr;
-  transient ObjectInspector writableObjectInspector;
-  transient Object writableValue;
+  transient ConstantObjectInspector writableObjectInspector;
 
   public ExprNodeConstantEvaluator(ExprNodeConstantDesc expr) {
     this.expr = expr;
-    PrimitiveCategory pc = ((PrimitiveTypeInfo) expr.getTypeInfo())
-        .getPrimitiveCategory();
-    writableObjectInspector = PrimitiveObjectInspectorFactory
-        .getPrimitiveWritableObjectInspector(pc);
-    // Convert from Java to Writable
-    writableValue = PrimitiveObjectInspectorFactory
-        .getPrimitiveJavaObjectInspector(pc).getPrimitiveWritableObject(
-        expr.getValue());
+    writableObjectInspector = expr.getWritableObjectInspector();
   }
 
   @Override
@@ -54,7 +44,7 @@ public class ExprNodeConstantEvaluator e
 
   @Override
   public Object evaluate(Object row) throws HiveException {
-    return writableValue;
+    return writableObjectInspector.getWritableConstantValue();
   }
 
 }

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java?rev=1158446&r1=1158445&r2=1158446&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java Tue Aug 16 21:00:07 2011
@@ -165,6 +165,7 @@ import org.apache.hadoop.hive.ql.udf.gen
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMap;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMapKeys;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMapValues;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFNamedStruct;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqual;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqualOrGreaterThan;
@@ -410,6 +411,7 @@ public final class FunctionRegistry {
     registerGenericUDF("array", GenericUDFArray.class);
     registerGenericUDF("map", GenericUDFMap.class);
     registerGenericUDF("struct", GenericUDFStruct.class);
+    registerGenericUDF("named_struct", GenericUDFNamedStruct.class);
     registerGenericUDF("create_union", GenericUDFUnion.class);
 
     registerGenericUDF("case", GenericUDFCase.class);

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeConstantDesc.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeConstantDesc.java?rev=1158446&r1=1158445&r2=1158446&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeConstantDesc.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeConstantDesc.java Tue Aug 16 21:00:07 2011
@@ -21,6 +21,10 @@ package org.apache.hadoop.hive.ql.plan;
 import java.io.Serializable;
 
 import org.apache.hadoop.hive.serde.Constants;
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
+import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
 
@@ -53,6 +57,19 @@ public class ExprNodeConstantDesc extend
   }
 
   @Override
+  public ConstantObjectInspector getWritableObjectInspector() {
+    PrimitiveCategory pc = ((PrimitiveTypeInfo)getTypeInfo())
+        .getPrimitiveCategory();
+    // Convert from Java to Writable
+    Object writableValue = PrimitiveObjectInspectorFactory
+        .getPrimitiveJavaObjectInspector(pc).getPrimitiveWritableObject(
+          getValue());
+    return PrimitiveObjectInspectorFactory
+        .getPrimitiveWritableConstantObjectInspector(pc, writableValue);
+  }
+
+
+  @Override
   public String toString() {
     return "Const " + typeInfo.toString() + " " + value;
   }

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDesc.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDesc.java?rev=1158446&r1=1158445&r2=1158446&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDesc.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDesc.java Tue Aug 16 21:00:07 2011
@@ -23,6 +23,8 @@ import java.util.List;
 
 import org.apache.hadoop.hive.ql.lib.Node;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
+import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 
 /**
  * ExprNodeDesc.
@@ -64,6 +66,11 @@ public abstract class ExprNodeDesc imple
     return null;
   }
 
+  public ObjectInspector getWritableObjectInspector() {
+    return TypeInfoUtils
+      .getStandardWritableObjectInspectorFromTypeInfo(typeInfo);
+  }
+
   @Explain(displayName = "type")
   public String getTypeString() {
     return typeInfo.getTypeName();

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java?rev=1158446&r1=1158445&r2=1158446&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java Tue Aug 16 21:00:07 2011
@@ -145,9 +145,7 @@ public class ExprNodeGenericFuncDesc ext
       List<ExprNodeDesc> children) throws UDFArgumentException {
     ObjectInspector[] childrenOIs = new ObjectInspector[children.size()];
     for (int i = 0; i < childrenOIs.length; i++) {
-      childrenOIs[i] = TypeInfoUtils
-          .getStandardWritableObjectInspectorFromTypeInfo(children.get(i)
-          .getTypeInfo());
+      childrenOIs[i] = children.get(i).getWritableObjectInspector();
     }
 
     ObjectInspector oi = genericUDF.initialize(childrenOIs);

Added: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java (added)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,89 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.udf.generic;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+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.Description;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantStringObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
+
+@Description(name = "named_struct",
+    value = "_FUNC_(name1, val1, name2, val2, ...) - Creates a struct with the given " +
+            "field names and values")
+public class GenericUDFNamedStruct extends GenericUDF {
+  Object[] ret;
+
+  @Override
+  public ObjectInspector initialize(ObjectInspector[] arguments)
+      throws UDFArgumentException {
+
+    int numFields = arguments.length;
+    if (numFields % 2 == 1) {
+      throw new UDFArgumentLengthException(
+          "NAMED_STRUCT expects an even number of arguments.");
+    }
+    ret = new Object[numFields / 2];
+
+    ArrayList<String> fname = new ArrayList<String>(numFields / 2);
+    ArrayList<ObjectInspector> retOIs = new ArrayList<ObjectInspector>(numFields / 2);
+    for (int f = 0; f < numFields; f+=2) {
+      if (!(arguments[f] instanceof WritableConstantStringObjectInspector)) {
+        throw new UDFArgumentTypeException(f, "Even arguments" +
+            " to NAMED_STRUCT must be a constant STRING." + arguments[f].toString());
+      }
+      WritableConstantStringObjectInspector constantOI =
+        (WritableConstantStringObjectInspector)arguments[f];
+      fname.add(constantOI.getWritableConstantValue().toString());
+      retOIs.add(arguments[f + 1]);
+    }
+    StructObjectInspector soi =
+      ObjectInspectorFactory.getStandardStructObjectInspector(fname, retOIs);
+    return soi;
+  }
+
+  @Override
+  public Object evaluate(DeferredObject[] arguments) throws HiveException {
+    for (int i = 0; i < arguments.length / 2; i++) {
+      ret[i] = arguments[2 * i + 1].get();
+    }
+    return ret;
+  }
+
+  @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();
+  }
+}

Propchange: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNamedStruct.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/ql/src/test/queries/clientpositive/udf_named_struct.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/udf_named_struct.q?rev=1158446&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/udf_named_struct.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/udf_named_struct.q Tue Aug 16 21:00:07 2011
@@ -0,0 +1,9 @@
+DESCRIBE FUNCTION named_struct;
+DESCRIBE FUNCTION EXTENDED named_struct;
+
+EXPLAIN
+SELECT named_struct("foo", 1, "bar", 2),
+       named_struct("foo", 1, "bar", 2).foo FROM src LIMIT 1;
+
+SELECT named_struct("foo", 1, "bar", 2),
+       named_struct("foo", 1, "bar", 2).foo FROM src LIMIT 1;

Modified: hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out?rev=1158446&r1=1158445&r2=1158446&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/show_functions.q.out Tue Aug 16 21:00:07 2011
@@ -98,6 +98,7 @@ max
 min
 minute
 month
+named_struct
 negative
 ngrams
 not

Added: hive/trunk/ql/src/test/results/clientpositive/udf_named_struct.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/udf_named_struct.q.out?rev=1158446&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/udf_named_struct.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/udf_named_struct.q.out Tue Aug 16 21:00:07 2011
@@ -0,0 +1,63 @@
+PREHOOK: query: DESCRIBE FUNCTION named_struct
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION named_struct
+POSTHOOK: type: DESCFUNCTION
+named_struct(name1, val1, name2, val2, ...) - Creates a struct with the given field names and values
+PREHOOK: query: DESCRIBE FUNCTION EXTENDED named_struct
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION EXTENDED named_struct
+POSTHOOK: type: DESCFUNCTION
+named_struct(name1, val1, name2, val2, ...) - Creates a struct with the given field names and values
+PREHOOK: query: EXPLAIN
+SELECT named_struct("foo", 1, "bar", 2),
+       named_struct("foo", 1, "bar", 2).foo FROM src LIMIT 1
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT named_struct("foo", 1, "bar", 2),
+       named_struct("foo", 1, "bar", 2).foo FROM src LIMIT 1
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION named_struct "foo" 1 "bar" 2)) (TOK_SELEXPR (. (TOK_FUNCTION named_struct "foo" 1 "bar" 2) foo))) (TOK_LIMIT 1)))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        src
+          TableScan
+            alias: src
+            Select Operator
+              expressions:
+                    expr: named_struct('foo',1,'bar',2)
+                    type: struct<foo:int,bar:int>
+                    expr: named_struct('foo',1,'bar',2).foo
+                    type: int
+              outputColumnNames: _col0, _col1
+              Limit
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+
+
+PREHOOK: query: SELECT named_struct("foo", 1, "bar", 2),
+       named_struct("foo", 1, "bar", 2).foo FROM src LIMIT 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: file:/var/folders/C4/C40caRNsEM4C4yVangruonVUe7Y/-Tmp-/jonchang/hive_2011-08-11_01-02-24_658_503462155153078291/-mr-10000
+POSTHOOK: query: SELECT named_struct("foo", 1, "bar", 2),
+       named_struct("foo", 1, "bar", 2).foo FROM src LIMIT 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: file:/var/folders/C4/C40caRNsEM4C4yVangruonVUe7Y/-Tmp-/jonchang/hive_2011-08-11_01-02-24_658_503462155153078291/-mr-10000
+{"foo":1,"bar":2}	1

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ConstantObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ConstantObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ConstantObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ConstantObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector;
+
+/**
+ * ConstantObjectInspector.  This interface should be implemented by
+ * ObjectInspectors which represent constant values and can return them without
+ * an evaluation.
+ */
+public interface ConstantObjectInspector extends ObjectInspector {
+
+  Object getWritableConstantValue();
+
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ConstantObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java?rev=1158446&r1=1158445&r2=1158446&view=diff
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java (original)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java Tue Aug 16 21:00:07 2011
@@ -20,10 +20,19 @@ package org.apache.hadoop.hive.serde2.ob
 
 import java.util.HashMap;
 
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
 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.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry;
 import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.BooleanWritable;
+import org.apache.hadoop.io.ByteWritable;
+import org.apache.hadoop.hive.serde2.io.ShortWritable;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.FloatWritable;
+import org.apache.hadoop.hive.serde2.io.DoubleWritable;
+import org.apache.hadoop.io.Text;
 
 /**
  * PrimitiveObjectInspectorFactory is the primary way to create new
@@ -145,6 +154,40 @@ public final class PrimitiveObjectInspec
   }
 
   /**
+   * Returns a PrimitiveWritableObjectInspector which implements ConstantObjectInspector
+   * for the PrimitiveCategory.
+   *
+   * @param primitiveCategory
+   * @param value
+   */
+  public static ConstantObjectInspector getPrimitiveWritableConstantObjectInspector(
+      PrimitiveCategory primitiveCategory, Object value) {
+    switch (primitiveCategory) {
+    case BOOLEAN:
+      return new WritableConstantBooleanObjectInspector((BooleanWritable)value);
+    case BYTE:
+      return new WritableConstantByteObjectInspector((ByteWritable)value);
+    case SHORT:
+      return new WritableConstantShortObjectInspector((ShortWritable)value);
+    case INT:
+      return new WritableConstantIntObjectInspector((IntWritable)value);
+    case LONG:
+      return new WritableConstantLongObjectInspector((LongWritable)value);
+    case FLOAT:
+      return new WritableConstantFloatObjectInspector((FloatWritable)value);
+    case DOUBLE:
+      return new WritableConstantDoubleObjectInspector((DoubleWritable)value);
+    case STRING:
+      return new WritableConstantStringObjectInspector((Text)value);
+    case VOID:
+      return new WritableConstantVoidObjectInspector();
+    default:
+      throw new RuntimeException("Internal error: Cannot find "
+        + "ConstantObjectInspector for " + primitiveCategory);
+    }
+  }
+
+  /**
    * Returns the PrimitiveJavaObjectInspector for the PrimitiveCategory.
    *
    * @param primitiveCategory

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantBooleanObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantBooleanObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantBooleanObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantBooleanObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.io.BooleanWritable;
+
+/**
+ * A WritableConstantBooleanObjectInspector is a WritableBooleanObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantBooleanObjectInspector extends
+    WritableBooleanObjectInspector implements
+    ConstantObjectInspector {
+
+  private BooleanWritable value;
+
+  WritableConstantBooleanObjectInspector(BooleanWritable value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public BooleanWritable getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantBooleanObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.io.ByteWritable;
+
+/**
+ * A WritableConstantByteObjectInspector is a WritableByteObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantByteObjectInspector extends
+    WritableByteObjectInspector implements
+    ConstantObjectInspector {
+
+  private ByteWritable value;
+
+  WritableConstantByteObjectInspector(ByteWritable value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public ByteWritable getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantDoubleObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantDoubleObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantDoubleObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantDoubleObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.hive.serde2.io.DoubleWritable;
+
+/**
+ * A WritableConstantDoubleObjectInspector is a WritableDoubleObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantDoubleObjectInspector extends
+    WritableDoubleObjectInspector implements
+    ConstantObjectInspector {
+
+  private DoubleWritable value;
+
+  WritableConstantDoubleObjectInspector(DoubleWritable value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public DoubleWritable getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantDoubleObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantFloatObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantFloatObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantFloatObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantFloatObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.io.FloatWritable;
+
+/**
+ * A WritableConstantFloatObjectInspector is a WritableFloatObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantFloatObjectInspector extends
+    WritableFloatObjectInspector implements
+    ConstantObjectInspector {
+
+  private FloatWritable value;
+
+  WritableConstantFloatObjectInspector(FloatWritable value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public FloatWritable getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantFloatObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantIntObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantIntObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantIntObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantIntObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.io.IntWritable;
+
+/**
+ * A WritableConstantIntObjectInspector is a WritableIntObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantIntObjectInspector extends
+    WritableIntObjectInspector implements
+    ConstantObjectInspector {
+
+  private IntWritable value;
+
+  WritableConstantIntObjectInspector(IntWritable value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public IntWritable getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantIntObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantLongObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantLongObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantLongObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantLongObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.io.LongWritable;
+
+/**
+ * A WritableConstantLongObjectInspector is a WritableLongObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantLongObjectInspector extends
+    WritableLongObjectInspector implements
+    ConstantObjectInspector {
+
+  private LongWritable value;
+
+  WritableConstantLongObjectInspector(LongWritable value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public LongWritable getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantLongObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantShortObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantShortObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantShortObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantShortObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.hive.serde2.io.ShortWritable;
+
+/**
+ * A WritableConstantShortObjectInspector is a WritableShortObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantShortObjectInspector extends
+    WritableShortObjectInspector implements
+    ConstantObjectInspector {
+
+  private ShortWritable value;
+
+  WritableConstantShortObjectInspector(ShortWritable value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public ShortWritable getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantShortObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantStringObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantStringObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantStringObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantStringObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+import org.apache.hadoop.io.Text;
+
+/**
+ * A WritableConstantStringObjectInspector is a WritableStringObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantStringObjectInspector extends
+    WritableStringObjectInspector implements
+    ConstantObjectInspector {
+
+  private Text value;
+
+  WritableConstantStringObjectInspector(Text value) {
+    super();
+    this.value = value;
+  }
+
+  @Override
+  public Text getWritableConstantValue() {
+    return value;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantStringObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantVoidObjectInspector.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantVoidObjectInspector.java?rev=1158446&view=auto
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantVoidObjectInspector.java (added)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantVoidObjectInspector.java Tue Aug 16 21:00:07 2011
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.serde2.objectinspector.primitive;
+
+import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
+
+/**
+ * A WritableConstantVoidObjectInspector is a WritableVoidObjectInspector
+ * that implements ConstantObjectInspector.
+ */
+public class WritableConstantVoidObjectInspector extends
+    WritableVoidObjectInspector implements
+    ConstantObjectInspector {
+
+  WritableConstantVoidObjectInspector() {
+    super();
+  }
+
+  @Override
+  public Object getWritableConstantValue() {
+    return null;
+  }
+}

Propchange: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantVoidObjectInspector.java
------------------------------------------------------------------------------
    svn:eol-style = native