hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amareshw...@apache.org
Subject svn commit: r1468783 [16/16] - in /hive/branches/HIVE-4115: ./ beeline/src/java/org/apache/hive/beeline/ beeline/src/test/org/ beeline/src/test/org/apache/ beeline/src/test/org/apache/hive/ beeline/src/test/org/apache/hive/beeline/ beeline/src/test/org...
Date Wed, 17 Apr 2013 07:29:46 GMT
Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_rank.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_rank.q.out?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_rank.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_rank.q.out Wed Apr 17 07:29:38 2013
@@ -263,106 +263,106 @@ POSTHOOK: query: select s, cume_dist() o
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@over10k
 #### A masked pattern was here ####
-holly allen	2.0112630732099757E-4
-wendy falkner	2.0112630732099757E-4
-david ovid	2.0112630732099757E-4
-victor garcia	2.0112630732099757E-4
-katie xylophone	2.0112630732099757E-4
-ulysses xylophone	2.0112630732099757E-4
-nick steinbeck	2.0112630732099757E-4
-ethan ellison	2.0112630732099757E-4
-nick quirinius	2.0112630732099757E-4
-irene garcia	2.0112630732099757E-4
-mike xylophone	2.0112630732099757E-4
-victor xylophone	2.0112630732099757E-4
-jessica steinbeck	2.0112630732099757E-4
-irene van buren	2.0112630732099757E-4
-quinn steinbeck	2.0112630732099757E-4
-calvin allen	2.0112630732099757E-4
-david zipper	2.0112630732099757E-4
-sarah miller	2.0112630732099757E-4
-ulysses nixon	2.0112630732099757E-4
-ulysses ichabod	2.0112630732099757E-4
-yuri nixon	2.0112630732099757E-4
-tom hernandez	2.0112630732099757E-4
-rachel thompson	2.0112630732099757E-4
-katie xylophone	0.004827031375703942
-oscar quirinius	0.004827031375703942
-rachel davidson	0.004827031375703942
-sarah van buren	0.004827031375703942
-ulysses allen	0.004827031375703942
-bob king	0.004827031375703942
-bob johnson	0.004827031375703942
-calvin van buren	0.004827031375703942
-tom king	0.004827031375703942
-zach young	0.004827031375703942
-zach allen	0.004827031375703942
-mike steinbeck	0.004827031375703942
-wendy ellison	0.004827031375703942
-gabriella robinson	0.004827031375703942
-xavier davidson	0.007642799678197908
-jessica miller	0.007642799678197908
-mike steinbeck	0.007642799678197908
-alice falkner	0.007642799678197908
-irene nixon	0.007642799678197908
-jessica brown	0.007642799678197908
-ethan ovid	0.007642799678197908
-ulysses king	0.007642799678197908
-gabriella davidson	0.007642799678197908
-jessica quirinius	0.007642799678197908
-luke falkner	0.007642799678197908
-luke robinson	0.007642799678197908
-priscilla hernandez	0.007642799678197908
-mike van buren	0.007642799678197908
-ulysses robinson	0.007642799678197908
-bob underhill	0.007642799678197908
-bob ovid	0.007642799678197908
-tom polk	0.007642799678197908
-gabriella garcia	0.007642799678197908
-wendy allen	0.011464199517296863
-victor robinson	0.011464199517296863
-calvin nixon	0.011464199517296863
-wendy nixon	0.011464199517296863
-mike falkner	0.011464199517296863
-nick falkner	0.011464199517296863
-priscilla nixon	0.011464199517296863
-david davidson	0.011464199517296863
-bob underhill	0.011464199517296863
-oscar laertes	0.011464199517296863
-oscar miller	0.011464199517296863
-priscilla xylophone	0.011464199517296863
-jessica robinson	0.011464199517296863
-quinn miller	0.011464199517296863
-yuri ellison	0.011464199517296863
-holly falkner	0.011464199517296863
-oscar thompson	0.011464199517296863
-irene laertes	0.011464199517296863
-alice hernandez	0.011464199517296863
-luke johnson	0.015285599356395816
-fred carson	0.015285599356395816
-nick allen	0.015285599356395816
-nick ellison	0.015285599356395816
-priscilla laertes	0.015285599356395816
-priscilla underhill	0.015285599356395816
-calvin nixon	0.015285599356395816
-oscar king	0.015285599356395816
-katie polk	0.015285599356395816
-irene king	0.015285599356395816
-jessica davidson	0.015285599356395816
-victor steinbeck	0.015285599356395816
-priscilla young	0.015285599356395816
-katie polk	0.015285599356395816
-holly davidson	0.015285599356395816
-wendy miller	0.015285599356395816
-zach johnson	0.01850362027353178
-mike falkner	0.01850362027353178
-victor zipper	0.01850362027353178
-wendy king	0.01850362027353178
-fred ellison	0.01850362027353178
-mike hernandez	0.01850362027353178
-xavier allen	0.01850362027353178
-zach zipper	0.01850362027353178
-ethan laertes	0.01850362027353178
+holly allen	0.004625905068382945
+wendy falkner	0.004625905068382945
+david ovid	0.004625905068382945
+victor garcia	0.004625905068382945
+katie xylophone	0.004625905068382945
+ulysses xylophone	0.004625905068382945
+nick steinbeck	0.004625905068382945
+ethan ellison	0.004625905068382945
+nick quirinius	0.004625905068382945
+irene garcia	0.004625905068382945
+mike xylophone	0.004625905068382945
+victor xylophone	0.004625905068382945
+jessica steinbeck	0.004625905068382945
+irene van buren	0.004625905068382945
+quinn steinbeck	0.004625905068382945
+calvin allen	0.004625905068382945
+david zipper	0.004625905068382945
+sarah miller	0.004625905068382945
+ulysses nixon	0.004625905068382945
+ulysses ichabod	0.004625905068382945
+yuri nixon	0.004625905068382945
+tom hernandez	0.004625905068382945
+rachel thompson	0.004625905068382945
+katie xylophone	0.007441673370876911
+oscar quirinius	0.007441673370876911
+rachel davidson	0.007441673370876911
+sarah van buren	0.007441673370876911
+ulysses allen	0.007441673370876911
+bob king	0.007441673370876911
+bob johnson	0.007441673370876911
+calvin van buren	0.007441673370876911
+tom king	0.007441673370876911
+zach young	0.007441673370876911
+zach allen	0.007441673370876911
+mike steinbeck	0.007441673370876911
+wendy ellison	0.007441673370876911
+gabriella robinson	0.007441673370876911
+xavier davidson	0.011263073209975865
+jessica miller	0.011263073209975865
+mike steinbeck	0.011263073209975865
+alice falkner	0.011263073209975865
+irene nixon	0.011263073209975865
+jessica brown	0.011263073209975865
+ethan ovid	0.011263073209975865
+ulysses king	0.011263073209975865
+gabriella davidson	0.011263073209975865
+jessica quirinius	0.011263073209975865
+luke falkner	0.011263073209975865
+luke robinson	0.011263073209975865
+priscilla hernandez	0.011263073209975865
+mike van buren	0.011263073209975865
+ulysses robinson	0.011263073209975865
+bob underhill	0.011263073209975865
+bob ovid	0.011263073209975865
+tom polk	0.011263073209975865
+gabriella garcia	0.011263073209975865
+wendy allen	0.015084473049074818
+victor robinson	0.015084473049074818
+calvin nixon	0.015084473049074818
+wendy nixon	0.015084473049074818
+mike falkner	0.015084473049074818
+nick falkner	0.015084473049074818
+priscilla nixon	0.015084473049074818
+david davidson	0.015084473049074818
+bob underhill	0.015084473049074818
+oscar laertes	0.015084473049074818
+oscar miller	0.015084473049074818
+priscilla xylophone	0.015084473049074818
+jessica robinson	0.015084473049074818
+quinn miller	0.015084473049074818
+yuri ellison	0.015084473049074818
+holly falkner	0.015084473049074818
+oscar thompson	0.015084473049074818
+irene laertes	0.015084473049074818
+alice hernandez	0.015084473049074818
+luke johnson	0.01830249396621078
+fred carson	0.01830249396621078
+nick allen	0.01830249396621078
+nick ellison	0.01830249396621078
+priscilla laertes	0.01830249396621078
+priscilla underhill	0.01830249396621078
+calvin nixon	0.01830249396621078
+oscar king	0.01830249396621078
+katie polk	0.01830249396621078
+irene king	0.01830249396621078
+jessica davidson	0.01830249396621078
+victor steinbeck	0.01830249396621078
+priscilla young	0.01830249396621078
+katie polk	0.01830249396621078
+holly davidson	0.01830249396621078
+wendy miller	0.01830249396621078
+zach johnson	0.02252614641995173
+mike falkner	0.02252614641995173
+victor zipper	0.02252614641995173
+wendy king	0.02252614641995173
+fred ellison	0.02252614641995173
+mike hernandez	0.02252614641995173
+xavier allen	0.02252614641995173
+zach zipper	0.02252614641995173
+ethan laertes	0.02252614641995173
 PREHOOK: query: select s, percent_rank() over (partition by dec order by f) from over10k limit 100
 PREHOOK: type: QUERY
 PREHOOK: Input: default@over10k

Modified: hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/groupby3.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/groupby3.q.xml?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/groupby3.q.xml (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/groupby3.q.xml Wed Apr 17 07:29:38 2013
@@ -630,7 +630,7 @@
                     <void method="add"> 
                      <object class="org.apache.hadoop.hive.ql.plan.AggregationDesc"> 
                       <void property="genericUDAFEvaluator"> 
-                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluator0" class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluator"/> 
+                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble0" class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble"/> 
                       </void> 
                       <void property="genericUDAFName"> 
                        <string>avg</string> 
@@ -697,7 +697,7 @@
                        <boolean>true</boolean> 
                       </void> 
                       <void property="genericUDAFEvaluator"> 
-                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluator1" class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluator"/> 
+                       <object id="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble1" class="org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble"/> 
                       </void> 
                       <void property="genericUDAFName"> 
                        <string>avg</string> 
@@ -1922,7 +1922,7 @@
           <void method="add"> 
            <object class="org.apache.hadoop.hive.ql.plan.AggregationDesc"> 
             <void property="genericUDAFEvaluator"> 
-             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluator0"/> 
+             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble0"/> 
             </void> 
             <void property="genericUDAFName"> 
              <string>avg</string> 
@@ -1952,7 +1952,7 @@
              <boolean>true</boolean> 
             </void> 
             <void property="genericUDAFEvaluator"> 
-             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluator1"/> 
+             <object idref="GenericUDAFAverage$GenericUDAFAverageEvaluatorDouble1"/> 
             </void> 
             <void property="genericUDAFName"> 
              <string>avg</string> 

Modified: hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join1.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join1.q.xml?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join1.q.xml (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join1.q.xml Wed Apr 17 07:29:38 2013
@@ -486,20 +486,6 @@
                 </void> 
                </object> 
               </void> 
-              <void method="put"> 
-               <string>VALUE._col0</string> 
-               <object class="org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc"> 
-                <void property="column"> 
-                 <string>key</string> 
-                </void> 
-                <void property="tabAlias"> 
-                 <string>src2</string> 
-                </void> 
-                <void property="typeInfo"> 
-                 <object idref="PrimitiveTypeInfo0"/> 
-                </void> 
-               </object> 
-              </void> 
              </object> 
             </void> 
             <void property="conf"> 

Modified: hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join2.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join2.q.xml?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join2.q.xml (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join2.q.xml Wed Apr 17 07:29:38 2013
@@ -349,20 +349,6 @@
                     </void> 
                    </object> 
                   </void> 
-                  <void method="put"> 
-                   <string>VALUE._col0</string> 
-                   <object class="org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc"> 
-                    <void property="column"> 
-                     <string>_col4</string> 
-                    </void> 
-                    <void property="tabAlias"> 
-                     <string>src2</string> 
-                    </void> 
-                    <void property="typeInfo"> 
-                     <object idref="PrimitiveTypeInfo0"/> 
-                    </void> 
-                   </object> 
-                  </void> 
                  </object> 
                 </void> 
                 <void property="conf"> 
@@ -650,20 +636,6 @@
                     </void> 
                    </object> 
                   </void> 
-                  <void method="put"> 
-                   <string>VALUE._col0</string> 
-                   <object class="org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc"> 
-                    <void property="column"> 
-                     <string>key</string> 
-                    </void> 
-                    <void property="tabAlias"> 
-                     <string>src3</string> 
-                    </void> 
-                    <void property="typeInfo"> 
-                     <object idref="PrimitiveTypeInfo0"/> 
-                    </void> 
-                   </object> 
-                  </void> 
                  </object> 
                 </void> 
                 <void property="conf"> 

Modified: hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join3.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join3.q.xml?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join3.q.xml (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/compiler/plan/join3.q.xml Wed Apr 17 07:29:38 2013
@@ -615,26 +615,7 @@
           <void method="add"> 
            <object id="ReduceSinkOperator0" class="org.apache.hadoop.hive.ql.exec.ReduceSinkOperator"> 
             <void property="columnExprMap"> 
-             <object class="java.util.HashMap"> 
-              <void method="put"> 
-               <string>VALUE._col0</string> 
-               <object class="org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc"> 
-                <void property="column"> 
-                 <string>key</string> 
-                </void> 
-                <void property="tabAlias"> 
-                 <string>src2</string> 
-                </void> 
-                <void property="typeInfo"> 
-                 <object id="PrimitiveTypeInfo0" class="org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo"> 
-                  <void property="typeName"> 
-                   <string>string</string> 
-                  </void> 
-                 </object> 
-                </void> 
-               </object> 
-              </void> 
-             </object> 
+             <object class="java.util.HashMap"/> 
             </void> 
             <void property="conf"> 
              <object class="org.apache.hadoop.hive.ql.plan.ReduceSinkDesc"> 
@@ -652,7 +633,11 @@
                    <string>src2</string> 
                   </void> 
                   <void property="typeInfo"> 
-                   <object idref="PrimitiveTypeInfo0"/> 
+                   <object id="PrimitiveTypeInfo0" class="org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo"> 
+                    <void property="typeName"> 
+                     <string>string</string> 
+                    </void> 
+                   </object> 
                   </void> 
                  </object> 
                 </void> 
@@ -911,20 +896,6 @@
                 </void> 
                </object> 
               </void> 
-              <void method="put"> 
-               <string>VALUE._col0</string> 
-               <object class="org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc"> 
-                <void property="column"> 
-                 <string>key</string> 
-                </void> 
-                <void property="tabAlias"> 
-                 <string>src3</string> 
-                </void> 
-                <void property="typeInfo"> 
-                 <object idref="PrimitiveTypeInfo0"/> 
-                </void> 
-               </object> 
-              </void> 
              </object> 
             </void> 
             <void property="conf"> 

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/DelimitedJSONSerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/DelimitedJSONSerDe.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/DelimitedJSONSerDe.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/DelimitedJSONSerDe.java Wed Apr 17 07:29:38 2013
@@ -55,8 +55,9 @@ public class DelimitedJSONSerDe extends 
   protected void serializeField(ByteStream.Output out, Object obj, ObjectInspector objInspector,
       SerDeParameters serdeParams) throws SerDeException {
     if (!objInspector.getCategory().equals(Category.PRIMITIVE) || (objInspector.getTypeName().equalsIgnoreCase(serdeConstants.BINARY_TYPE_NAME))) {
+      //do this for all complex types and binary
       try {
-        serialize(out, SerDeUtils.getJSONString(obj, objInspector),
+        serialize(out, SerDeUtils.getJSONString(obj, objInspector, serdeParams.getNullSequence().toString()),
             PrimitiveObjectInspectorFactory.javaStringObjectInspector, serdeParams.getSeparators(),
             1, serdeParams.getNullSequence(), serdeParams.isEscaped(), serdeParams.getEscapeChar(),
             serdeParams.getNeedsEscape());
@@ -66,6 +67,7 @@ public class DelimitedJSONSerDe extends 
       }
 
     } else {
+      //primitives except binary
       super.serializeField(out, obj, objInspector, serdeParams);
     }
   }

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/RegexSerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/RegexSerDe.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/RegexSerDe.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/RegexSerDe.java Wed Apr 17 07:29:38 2013
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.hive.serde2;
 
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -28,6 +27,7 @@ import java.util.regex.Pattern;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
@@ -135,7 +135,7 @@ public class RegexSerDe extends Abstract
       } else if (typeName.equals(serdeConstants.BOOLEAN_TYPE_NAME)) {
         columnOIs.add(PrimitiveObjectInspectorFactory.javaBooleanObjectInspector);
       } else if (typeName.equals(serdeConstants.DECIMAL_TYPE_NAME)) {
-        columnOIs.add(PrimitiveObjectInspectorFactory.javaBigDecimalObjectInspector);
+        columnOIs.add(PrimitiveObjectInspectorFactory.javaHiveDecimalObjectInspector);
       } else {
          throw new SerDeException(getClass().getName()
          + " doesn't allow column [" + c + "] named "
@@ -230,8 +230,8 @@ public class RegexSerDe extends Abstract
           b = Boolean.valueOf(t);
           row.set(c, b);
         } else if (typeName.equals(serdeConstants.DECIMAL_TYPE_NAME)) {
-          BigDecimal bd;
-          bd = new BigDecimal(t);
+          HiveDecimal bd;
+          bd = new HiveDecimal(t);
           row.set(c, bd);
         }
       } catch (RuntimeException e) {

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java Wed Apr 17 07:29:38 2013
@@ -34,7 +34,7 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.StructField;
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.UnionObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.BigDecimalObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ByteObjectInspector;
@@ -62,6 +62,9 @@ public final class SerDeUtils {
   public static final String LBRACE = "{";
   public static final String RBRACE = "}";
 
+  // lower case null is used within json objects
+  private static final String JSON_NULL = "null";
+
   private static ConcurrentHashMap<String, Class<?>> serdes =
     new ConcurrentHashMap<String, Class<?>>();
 
@@ -216,18 +219,32 @@ public final class SerDeUtils {
   }
 
   public static String getJSONString(Object o, ObjectInspector oi) {
+    return getJSONString(o, oi, JSON_NULL);
+  }
+
+  /**
+   * Use this if you need to have custom representation of top level null .
+   * (ie something other than 'null')
+   * eg, for hive output, we want to to print NULL for a null map object.
+   * @param o Object
+   * @param oi ObjectInspector
+   * @param nullStr The custom string used to represent null value
+   * @return
+   */
+  public static String getJSONString(Object o, ObjectInspector oi, String nullStr) {
     StringBuilder sb = new StringBuilder();
-    buildJSONString(sb, o, oi);
+    buildJSONString(sb, o, oi, nullStr);
     return sb.toString();
   }
 
-  static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
+
+  static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi, String nullStr) {
 
     switch (oi.getCategory()) {
     case PRIMITIVE: {
       PrimitiveObjectInspector poi = (PrimitiveObjectInspector) oi;
       if (o == null) {
-        sb.append("null");
+        sb.append(nullStr);
       } else {
         switch (poi.getPrimitiveCategory()) {
         case BOOLEAN: {
@@ -281,7 +298,7 @@ public final class SerDeUtils {
           break;
         }
         case DECIMAL: {
-          sb.append(((BigDecimalObjectInspector) oi).getPrimitiveJavaObject(o));
+          sb.append(((HiveDecimalObjectInspector) oi).getPrimitiveJavaObject(o));
           break;
         }
         default:
@@ -297,14 +314,14 @@ public final class SerDeUtils {
           .getListElementObjectInspector();
       List<?> olist = loi.getList(o);
       if (olist == null) {
-        sb.append("null");
+        sb.append(nullStr);
       } else {
         sb.append(LBRACKET);
         for (int i = 0; i < olist.size(); i++) {
           if (i > 0) {
             sb.append(COMMA);
           }
-          buildJSONString(sb, olist.get(i), listElementObjectInspector);
+          buildJSONString(sb, olist.get(i), listElementObjectInspector, JSON_NULL);
         }
         sb.append(RBRACKET);
       }
@@ -317,7 +334,7 @@ public final class SerDeUtils {
           .getMapValueObjectInspector();
       Map<?, ?> omap = moi.getMap(o);
       if (omap == null) {
-        sb.append("null");
+        sb.append(nullStr);
       } else {
         sb.append(LBRACE);
         boolean first = true;
@@ -328,9 +345,9 @@ public final class SerDeUtils {
             sb.append(COMMA);
           }
           Map.Entry<?, ?> e = (Map.Entry<?, ?>) entry;
-          buildJSONString(sb, e.getKey(), mapKeyObjectInspector);
+          buildJSONString(sb, e.getKey(), mapKeyObjectInspector, JSON_NULL);
           sb.append(COLON);
-          buildJSONString(sb, e.getValue(), mapValueObjectInspector);
+          buildJSONString(sb, e.getValue(), mapValueObjectInspector, JSON_NULL);
         }
         sb.append(RBRACE);
       }
@@ -340,7 +357,7 @@ public final class SerDeUtils {
       StructObjectInspector soi = (StructObjectInspector) oi;
       List<? extends StructField> structFields = soi.getAllStructFieldRefs();
       if (o == null) {
-        sb.append("null");
+        sb.append(nullStr);
       } else {
         sb.append(LBRACE);
         for (int i = 0; i < structFields.size(); i++) {
@@ -352,7 +369,7 @@ public final class SerDeUtils {
           sb.append(QUOTE);
           sb.append(COLON);
           buildJSONString(sb, soi.getStructFieldData(o, structFields.get(i)),
-              structFields.get(i).getFieldObjectInspector());
+              structFields.get(i).getFieldObjectInspector(), JSON_NULL);
         }
         sb.append(RBRACE);
       }
@@ -361,13 +378,13 @@ public final class SerDeUtils {
     case UNION: {
       UnionObjectInspector uoi = (UnionObjectInspector) oi;
       if (o == null) {
-        sb.append("null");
+        sb.append(nullStr);
       } else {
         sb.append(LBRACE);
         sb.append(uoi.getTag(o));
         sb.append(COLON);
         buildJSONString(sb, uoi.getField(o),
-              uoi.getObjectInspectors().get(uoi.getTag(o)));
+              uoi.getObjectInspectors().get(uoi.getTag(o)), JSON_NULL);
         sb.append(RBRACE);
       }
       break;

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java Wed Apr 17 07:29:38 2013
@@ -61,8 +61,6 @@ public class AvroSerDe extends AbstractS
     if(configuration == null) {
       LOG.info("Configuration null, not inserting schema");
     } else {
-      // force output files to have a .avro extension
-      configuration.set("hive.output.file.extension", ".avro");
       configuration.set(AvroSerdeUtils.AVRO_SERDE_SCHEMA, schema.toString(false));
     }
 

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java Wed Apr 17 07:29:38 2013
@@ -19,7 +19,6 @@
 package org.apache.hadoop.hive.serde2.binarysortable;
 
 import java.io.IOException;
-import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
@@ -32,13 +31,14 @@ import java.util.Properties;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.AbstractSerDe;
 import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.SerDeStats;
-import org.apache.hadoop.hive.serde2.io.BigDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.ByteWritable;
 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.ShortWritable;
 import org.apache.hadoop.hive.serde2.io.TimestampWritable;
 import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
@@ -49,12 +49,12 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.StructField;
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.UnionObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.BigDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ByteObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.FloatObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ShortObjectInspector;
@@ -382,8 +382,8 @@ public class BinarySortableSerDe extends
       case DECIMAL: {
         // See serialization of decimal for explanation (below)
 
-        BigDecimalWritable bdw = (reuse == null ? new BigDecimalWritable() :
-          (BigDecimalWritable) reuse);
+        HiveDecimalWritable bdw = (reuse == null ? new HiveDecimalWritable() :
+          (HiveDecimalWritable) reuse);
 
         int b = buffer.read(invert) - 1;
         assert (b == 1 || b == -1 || b == 0);
@@ -427,7 +427,7 @@ public class BinarySortableSerDe extends
 
         String digits = new String(decimalBuffer, 0, length, decimalCharSet);
         BigInteger bi = new BigInteger(digits);
-        BigDecimal bd = new BigDecimal(bi).scaleByPowerOfTen(factor-length);
+        HiveDecimal bd = new HiveDecimal(bi).scaleByPowerOfTen(factor-length);
 
         if (!positive) {
           bd = bd.negate();
@@ -688,11 +688,11 @@ public class BinarySortableSerDe extends
         // Factor is -2 (move decimal point 2 positions right)
         // Digits are: 123
 
-        BigDecimalObjectInspector boi = (BigDecimalObjectInspector) poi;
-        BigDecimal dec = boi.getPrimitiveJavaObject(o).stripTrailingZeros();
+        HiveDecimalObjectInspector boi = (HiveDecimalObjectInspector) poi;
+        HiveDecimal dec = boi.getPrimitiveJavaObject(o);
 
         // get the sign of the big decimal
-        int sign = dec.compareTo(BigDecimal.ZERO);
+        int sign = dec.compareTo(HiveDecimal.ZERO);
 
         // we'll encode the absolute value (sign is separate)
         dec = dec.abs();
@@ -788,6 +788,7 @@ public class BinarySortableSerDe extends
     }
     buffer.write((byte) 0, invert);
   }
+  @Override
   public SerDeStats getSerDeStats() {
     // no support for statistics
     return null;

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritable.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritable.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritable.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritable.java Wed Apr 17 07:29:38 2013
@@ -29,6 +29,7 @@ import java.util.Arrays;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde2.ByteStream.Output;
 import org.apache.hadoop.hive.serde2.lazybinary.LazyBinaryUtils;
 import org.apache.hadoop.hive.serde2.lazybinary.LazyBinaryUtils.VInt;
@@ -451,10 +452,10 @@ public class TimestampWritable implement
     return doubleToTimestamp((double) f);
   }
 
-  public static Timestamp decimalToTimestamp(BigDecimal d) {
+  public static Timestamp decimalToTimestamp(HiveDecimal d) {
     BigDecimal seconds = new BigDecimal(d.longValue());
-    long millis = d.multiply(new BigDecimal(1000)).longValue();
-    int nanos = d.subtract(seconds).multiply(new BigDecimal(1000000000)).intValue();
+    long millis = d.bigDecimalValue().multiply(new BigDecimal(1000)).longValue();
+    int nanos = d.bigDecimalValue().subtract(seconds).multiply(new BigDecimal(1000000000)).intValue();
 
     Timestamp t = new Timestamp(millis);
     t.setNanos(nanos);

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyFactory.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyFactory.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyFactory.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyFactory.java Wed Apr 17 07:29:38 2013
@@ -26,7 +26,7 @@ import org.apache.hadoop.hive.serde2.laz
 import org.apache.hadoop.hive.serde2.lazy.objectinspector.LazyObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.lazy.objectinspector.LazySimpleStructObjectInspector;
 import org.apache.hadoop.hive.serde2.lazy.objectinspector.LazyUnionObjectInspector;
-import org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyBigDecimalObjectInspector;
+import org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyHiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyBinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyBooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyByteObjectInspector;
@@ -114,7 +114,7 @@ public final class LazyFactory {
     case BINARY:
       return new LazyBinary((LazyBinaryObjectInspector) oi);
     case DECIMAL:
-      return new LazyBigDecimal((LazyBigDecimalObjectInspector) oi);
+      return new LazyHiveDecimal((LazyHiveDecimalObjectInspector) oi);
     default:
       throw new RuntimeException("Internal error: no LazyObject for " + p);
     }

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyUtils.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyUtils.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyUtils.java Wed Apr 17 07:29:38 2013
@@ -21,7 +21,6 @@ package org.apache.hadoop.hive.serde2.la
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.math.BigDecimal;
 import java.nio.ByteBuffer;
 import java.nio.charset.CharacterCodingException;
 import java.util.ArrayList;
@@ -29,11 +28,12 @@ import java.util.Arrays;
 import java.util.Properties;
 
 import org.apache.commons.codec.binary.Base64;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.SerDeParameters;
 import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.BigDecimalObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ByteObjectInspector;
@@ -238,7 +238,7 @@ public final class LazyUtils {
       break;
     }
     case DECIMAL: {
-      BigDecimal bd = ((BigDecimalObjectInspector) oi).getPrimitiveJavaObject(o);
+      HiveDecimal bd = ((HiveDecimalObjectInspector) oi).getPrimitiveJavaObject(o);
       ByteBuffer b = Text.encode(bd.toString());
       out.write(b.array(), 0, b.limit());
       break;

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/objectinspector/primitive/LazyPrimitiveObjectInspectorFactory.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/objectinspector/primitive/LazyPrimitiveObjectInspectorFactory.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/objectinspector/primitive/LazyPrimitiveObjectInspectorFactory.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazy/objectinspector/primitive/LazyPrimitiveObjectInspectorFactory.java Wed Apr 17 07:29:38 2013
@@ -57,8 +57,8 @@ public final class LazyPrimitiveObjectIn
       new LazyTimestampObjectInspector();
   public static final LazyBinaryObjectInspector LAZY_BINARY_OBJECT_INSPECTOR =
       new LazyBinaryObjectInspector();
-  public static final LazyBigDecimalObjectInspector LAZY_BIG_DECIMAL_OBJECT_INSPECTOR =
-      new LazyBigDecimalObjectInspector();
+  public static final LazyHiveDecimalObjectInspector LAZY_BIG_DECIMAL_OBJECT_INSPECTOR =
+      new LazyHiveDecimalObjectInspector();
 
   static HashMap<ArrayList<Object>, LazyStringObjectInspector> cachedLazyStringObjectInspector =
       new HashMap<ArrayList<Object>, LazyStringObjectInspector>();

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryFactory.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryFactory.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryFactory.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryFactory.java Wed Apr 17 07:29:38 2013
@@ -27,7 +27,7 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
 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.WritableBigDecimalObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableBinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableBooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableByteObjectInspector;
@@ -77,7 +77,7 @@ public final class LazyBinaryFactory {
     case BINARY:
       return new LazyBinaryBinary((WritableBinaryObjectInspector) oi);
     case DECIMAL:
-      return new LazyBinaryBigDecimal((WritableBigDecimalObjectInspector) oi);
+      return new LazyBinaryHiveDecimal((WritableHiveDecimalObjectInspector) oi);
     default:
       throw new RuntimeException("Internal error: no LazyBinaryObject for " + p);
     }

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinarySerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinarySerDe.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinarySerDe.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinarySerDe.java Wed Apr 17 07:29:38 2013
@@ -33,7 +33,7 @@ import org.apache.hadoop.hive.serde2.Byt
 import org.apache.hadoop.hive.serde2.ByteStream.Output;
 import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.SerDeStats;
-import org.apache.hadoop.hive.serde2.io.BigDecimalWritable;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.TimestampWritable;
 import org.apache.hadoop.hive.serde2.lazy.ByteArrayRef;
 import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
@@ -43,7 +43,7 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.StructField;
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.BigDecimalObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ByteObjectInspector;
@@ -386,8 +386,8 @@ public class LazyBinarySerDe extends Abs
       }
 
       case DECIMAL: {
-        BigDecimalObjectInspector bdoi = (BigDecimalObjectInspector) poi;
-        BigDecimalWritable t = bdoi.getPrimitiveWritableObject(obj);
+        HiveDecimalObjectInspector bdoi = (HiveDecimalObjectInspector) poi;
+        HiveDecimalWritable t = bdoi.getPrimitiveWritableObject(obj);
         t.writeToByteStream(byteStream);
         return warnedOnceNullMapKey;
       }

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorConverters.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorConverters.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorConverters.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorConverters.java Wed Apr 17 07:29:38 2013
@@ -25,7 +25,7 @@ import java.util.Map;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaStringObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorConverter;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableBigDecimalObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableHiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableBinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableBooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableByteObjectInspector;
@@ -109,9 +109,9 @@ public final class ObjectInspectorConver
           inputOI,
           (SettableBinaryObjectInspector)outputOI);
     case DECIMAL:
-      return new PrimitiveObjectInspectorConverter.BigDecimalConverter(
+      return new PrimitiveObjectInspectorConverter.HiveDecimalConverter(
           (PrimitiveObjectInspector) inputOI,
-          (SettableBigDecimalObjectInspector) outputOI);
+          (SettableHiveDecimalObjectInspector) outputOI);
     default:
       throw new RuntimeException("Hive internal error: conversion of "
           + inputOI.getTypeName() + " to " + outputOI.getTypeName()

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java Wed Apr 17 07:29:38 2013
@@ -30,12 +30,12 @@ import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hive.serde.serdeConstants;
-import org.apache.hadoop.hive.serde2.io.BigDecimalWritable;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.TimestampWritable;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.ObjectInspectorOptions;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.AbstractPrimitiveWritableObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.BigDecimalObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ByteObjectInspector;
@@ -493,7 +493,7 @@ public final class ObjectInspectorUtils 
             .getPrimitiveWritableObject(o);
         return t.hashCode();
       case DECIMAL:
-        return ((BigDecimalObjectInspector) poi).getPrimitiveWritableObject(o).hashCode();
+        return ((HiveDecimalObjectInspector) poi).getPrimitiveWritableObject(o).hashCode();
 
       default: {
         throw new RuntimeException("Unknown type: "
@@ -680,9 +680,9 @@ public final class ObjectInspectorUtils 
         return t1.compareTo(t2);
       }
       case DECIMAL: {
-        BigDecimalWritable t1 = ((BigDecimalObjectInspector) poi1)
+        HiveDecimalWritable t1 = ((HiveDecimalObjectInspector) poi1)
             .getPrimitiveWritableObject(o1);
-        BigDecimalWritable t2 = ((BigDecimalObjectInspector) poi2)
+        HiveDecimalWritable t2 = ((HiveDecimalObjectInspector) poi2)
             .getPrimitiveWritableObject(o2);
         return t1.compareTo(t2);
       }

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorConverter.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorConverter.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorConverter.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorConverter.java Wed Apr 17 07:29:38 2013
@@ -18,9 +18,9 @@
 
 package org.apache.hadoop.hive.serde2.objectinspector.primitive;
 
-import java.math.BigDecimal;
 import java.sql.Timestamp;
 
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde2.ByteStream;
 import org.apache.hadoop.hive.serde2.lazy.LazyInteger;
 import org.apache.hadoop.hive.serde2.lazy.LazyLong;
@@ -258,17 +258,17 @@ public class PrimitiveObjectInspectorCon
     }
   }
 
-  public static class BigDecimalConverter implements Converter {
+  public static class HiveDecimalConverter implements Converter {
 
     PrimitiveObjectInspector inputOI;
-    SettableBigDecimalObjectInspector outputOI;
+    SettableHiveDecimalObjectInspector outputOI;
     Object r;
 
-    public BigDecimalConverter(PrimitiveObjectInspector inputOI,
-        SettableBigDecimalObjectInspector outputOI) {
+    public HiveDecimalConverter(PrimitiveObjectInspector inputOI,
+        SettableHiveDecimalObjectInspector outputOI) {
       this.inputOI = inputOI;
       this.outputOI = outputOI;
-      this.r = outputOI.create(BigDecimal.ZERO);
+      this.r = outputOI.create(HiveDecimal.ZERO);
     }
 
     @Override
@@ -276,10 +276,14 @@ public class PrimitiveObjectInspectorCon
       if (input == null) {
         return null;
       }
-      return outputOI.set(r, PrimitiveObjectInspectorUtils.getBigDecimal(input,
-          inputOI));
+      
+      try {
+        return outputOI.set(r, PrimitiveObjectInspectorUtils.getHiveDecimal(input,
+            inputOI));
+      } catch (NumberFormatException e) {
+        return null;
+      }
     }
-
   }
 
   public static class BinaryConverter implements Converter{
@@ -372,7 +376,7 @@ public class PrimitiveObjectInspectorCon
         t.set(((BinaryObjectInspector) inputOI).getPrimitiveWritableObject(input).getBytes());
         return t;
       case DECIMAL:
-        t.set(((BigDecimalObjectInspector) inputOI).getPrimitiveWritableObject(input).toString());
+        t.set(((HiveDecimalObjectInspector) inputOI).getPrimitiveWritableObject(input).toString());
         return t;
       default:
         throw new RuntimeException("Hive 2 Internal error: type = " + inputOI.getTypeName());

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java Wed Apr 17 07:29:38 2013
@@ -20,7 +20,7 @@ package org.apache.hadoop.hive.serde2.ob
 
 import java.util.HashMap;
 
-import org.apache.hadoop.hive.serde2.io.BigDecimalWritable;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.ByteWritable;
 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
 import org.apache.hadoop.hive.serde2.io.ShortWritable;
@@ -70,8 +70,8 @@ public final class PrimitiveObjectInspec
       new JavaTimestampObjectInspector();
   public static final JavaBinaryObjectInspector javaByteArrayObjectInspector =
       new JavaBinaryObjectInspector();
-  public static final JavaBigDecimalObjectInspector javaBigDecimalObjectInspector =
-      new JavaBigDecimalObjectInspector();
+  public static final JavaHiveDecimalObjectInspector javaHiveDecimalObjectInspector =
+      new JavaHiveDecimalObjectInspector();
 
   public static final WritableBooleanObjectInspector writableBooleanObjectInspector =
       new WritableBooleanObjectInspector();
@@ -95,8 +95,8 @@ public final class PrimitiveObjectInspec
       new WritableTimestampObjectInspector();
   public static final WritableBinaryObjectInspector writableBinaryObjectInspector =
       new WritableBinaryObjectInspector();
-  public static final WritableBigDecimalObjectInspector writableBigDecimalObjectInspector =
-      new WritableBigDecimalObjectInspector();
+  public static final WritableHiveDecimalObjectInspector writableHiveDecimalObjectInspector =
+      new WritableHiveDecimalObjectInspector();
 
   private static HashMap<PrimitiveCategory, AbstractPrimitiveWritableObjectInspector> cachedPrimitiveWritableInspectorCache =
       new HashMap<PrimitiveCategory, AbstractPrimitiveWritableObjectInspector>();
@@ -124,7 +124,7 @@ public final class PrimitiveObjectInspec
     cachedPrimitiveWritableInspectorCache.put(PrimitiveCategory.BINARY,
         writableBinaryObjectInspector);
     cachedPrimitiveWritableInspectorCache.put(PrimitiveCategory.DECIMAL,
-        writableBigDecimalObjectInspector);
+        writableHiveDecimalObjectInspector);
   }
 
   private static HashMap<PrimitiveCategory, AbstractPrimitiveJavaObjectInspector> cachedPrimitiveJavaInspectorCache =
@@ -153,7 +153,7 @@ public final class PrimitiveObjectInspec
     cachedPrimitiveJavaInspectorCache.put(PrimitiveCategory.BINARY,
         javaByteArrayObjectInspector);
     cachedPrimitiveJavaInspectorCache.put(PrimitiveCategory.DECIMAL,
-        javaBigDecimalObjectInspector);
+        javaHiveDecimalObjectInspector);
   }
 
   /**
@@ -201,7 +201,7 @@ public final class PrimitiveObjectInspec
     case TIMESTAMP:
       return new WritableConstantTimestampObjectInspector((TimestampWritable)value);
     case DECIMAL:
-      return new WritableConstantBigDecimalObjectInspector((BigDecimalWritable)value);
+      return new WritableConstantHiveDecimalObjectInspector((HiveDecimalWritable)value);
     case BINARY:
       return new WritableConstantBinaryObjectInspector((BytesWritable)value);
     case VOID:

Modified: hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java (original)
+++ hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java Wed Apr 17 07:29:38 2013
@@ -21,15 +21,15 @@ package org.apache.hadoop.hive.serde2.ob
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde.serdeConstants;
-import org.apache.hadoop.hive.serde2.io.BigDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.ByteWritable;
 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
 import org.apache.hadoop.hive.serde2.io.ShortWritable;
 import org.apache.hadoop.hive.serde2.io.TimestampWritable;
 import org.apache.hadoop.hive.serde2.lazy.LazyInteger;
@@ -183,7 +183,7 @@ public final class PrimitiveObjectInspec
       Timestamp.class, TimestampWritable.class);
   public static final PrimitiveTypeEntry decimalTypeEntry = new PrimitiveTypeEntry(
       PrimitiveCategory.DECIMAL, serdeConstants.DECIMAL_TYPE_NAME, null,
-      BigDecimal.class, BigDecimalWritable.class);
+      HiveDecimal.class, HiveDecimalWritable.class);
 
   // The following is a complex type for special handling
   public static final PrimitiveTypeEntry unknownTypeEntry = new PrimitiveTypeEntry(
@@ -370,8 +370,8 @@ public final class PrimitiveObjectInspec
           equals(((BinaryObjectInspector) oi2).getPrimitiveWritableObject(o2));
     }
     case DECIMAL: {
-      return ((BigDecimalObjectInspector) oi1).getPrimitiveJavaObject(o1)
-          .compareTo(((BigDecimalObjectInspector) oi2).getPrimitiveJavaObject(o2)) == 0;
+      return ((HiveDecimalObjectInspector) oi1).getPrimitiveJavaObject(o1)
+          .compareTo(((HiveDecimalObjectInspector) oi2).getPrimitiveJavaObject(o2)) == 0;
     }
     default:
       return false;
@@ -403,7 +403,7 @@ public final class PrimitiveObjectInspec
       return ((TimestampObjectInspector) oi).getPrimitiveWritableObject(o)
           .getDouble();
     case DECIMAL:
-      return ((BigDecimalObjectInspector) oi).getPrimitiveJavaObject(o).doubleValue();
+      return ((HiveDecimalObjectInspector) oi).getPrimitiveJavaObject(o).doubleValue();
     default:
       throw new NumberFormatException();
     }
@@ -479,8 +479,8 @@ public final class PrimitiveObjectInspec
           .getPrimitiveWritableObject(o).getSeconds() != 0);
       break;
     case DECIMAL:
-      result = BigDecimal.ZERO.compareTo(
-          ((BigDecimalObjectInspector) oi).getPrimitiveJavaObject(o)) != 0;
+      result = HiveDecimal.ZERO.compareTo(
+          ((HiveDecimalObjectInspector) oi).getPrimitiveJavaObject(o)) != 0;
       break;
     default:
       throw new RuntimeException("Hive 2 Internal error: unknown type: "
@@ -563,7 +563,7 @@ public final class PrimitiveObjectInspec
           .getPrimitiveWritableObject(o).getSeconds());
       break;
     case DECIMAL:
-      result = ((BigDecimalObjectInspector) oi)
+      result = ((HiveDecimalObjectInspector) oi)
           .getPrimitiveJavaObject(o).intValue();
       break;
     default: {
@@ -621,7 +621,7 @@ public final class PrimitiveObjectInspec
           .getSeconds();
       break;
     case DECIMAL:
-      result = ((BigDecimalObjectInspector) oi)
+      result = ((HiveDecimalObjectInspector) oi)
           .getPrimitiveJavaObject(o).longValue();
       break;
     default:
@@ -672,7 +672,7 @@ public final class PrimitiveObjectInspec
       result = ((TimestampObjectInspector) oi).getPrimitiveWritableObject(o).getDouble();
       break;
     case DECIMAL:
-      result = ((BigDecimalObjectInspector) oi)
+      result = ((HiveDecimalObjectInspector) oi)
           .getPrimitiveJavaObject(o).doubleValue();
       break;
     default:
@@ -736,7 +736,7 @@ public final class PrimitiveObjectInspec
       result = ((TimestampObjectInspector) oi).getPrimitiveWritableObject(o).toString();
       break;
     case DECIMAL:
-      result = ((BigDecimalObjectInspector) oi)
+      result = ((HiveDecimalObjectInspector) oi)
           .getPrimitiveJavaObject(o).toString();
       break;
     default:
@@ -772,54 +772,54 @@ public final class PrimitiveObjectInspec
     }
   }
 
-  public static BigDecimal getBigDecimal(Object o, PrimitiveObjectInspector oi) {
+  public static HiveDecimal getHiveDecimal(Object o, PrimitiveObjectInspector oi) {
     if (o == null) {
       return null;
     }
 
-    BigDecimal result = null;
+    HiveDecimal result = null;
     switch (oi.getPrimitiveCategory()) {
     case VOID:
       result = null;
       break;
     case BOOLEAN:
       result = ((BooleanObjectInspector) oi).get(o) ?
-          BigDecimal.ONE : BigDecimal.ZERO;
+        HiveDecimal.ONE : HiveDecimal.ZERO;
       break;
     case BYTE:
-      result = new BigDecimal(((ByteObjectInspector) oi).get(o));
+      result = new HiveDecimal(((ByteObjectInspector) oi).get(o));
       break;
     case SHORT:
-      result = new BigDecimal(((ShortObjectInspector) oi).get(o));
+      result = new HiveDecimal(((ShortObjectInspector) oi).get(o));
       break;
     case INT:
-      result = new BigDecimal(((IntObjectInspector) oi).get(o));
+      result = new HiveDecimal(((IntObjectInspector) oi).get(o));
       break;
     case LONG:
-      result = new BigDecimal(((LongObjectInspector) oi).get(o));
+      result = new HiveDecimal(((LongObjectInspector) oi).get(o));
       break;
     case FLOAT:
       Float f = ((FloatObjectInspector) oi).get(o);
-      result = new BigDecimal(f.toString());
+      result = new HiveDecimal(f.toString());
       break;
     case DOUBLE:
       Double d = ((DoubleObjectInspector) oi).get(o);
-      result = new BigDecimal(d.toString());
+      result = new HiveDecimal(d.toString());
       break;
     case STRING:
-      result = new BigDecimal(((StringObjectInspector) oi).getPrimitiveJavaObject(o));
+      result = new HiveDecimal(((StringObjectInspector) oi).getPrimitiveJavaObject(o));
       break;
     case TIMESTAMP:
       Double ts = ((TimestampObjectInspector) oi).getPrimitiveWritableObject(o)
-          .getDouble();
-      result = new BigDecimal(ts.toString());
+        .getDouble();
+      result = new HiveDecimal(ts.toString());
       break;
     case DECIMAL:
-      result = ((BigDecimalObjectInspector) oi).getPrimitiveJavaObject(o);
+      result = ((HiveDecimalObjectInspector) oi).getPrimitiveJavaObject(o);
       break;
     default:
       throw new RuntimeException("Hive 2 Internal error: unknown type: "
-          + oi.getTypeName());
+                                 + oi.getTypeName());
     }
     return result;
   }
@@ -856,7 +856,7 @@ public final class PrimitiveObjectInspec
       result = TimestampWritable.doubleToTimestamp(((DoubleObjectInspector) oi).get(o));
       break;
     case DECIMAL:
-      result = TimestampWritable.decimalToTimestamp(((BigDecimalObjectInspector) oi)
+      result = TimestampWritable.decimalToTimestamp(((HiveDecimalObjectInspector) oi)
                                                     .getPrimitiveJavaObject(o));
       break;
     case STRING:

Modified: hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/TestStatsSerde.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/TestStatsSerde.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/TestStatsSerde.java (original)
+++ hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/TestStatsSerde.java Wed Apr 17 07:29:38 2013
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hive.serde2;
 
-import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.List;
 import java.util.Properties;
@@ -27,6 +26,7 @@ import java.util.Random;
 import junit.framework.TestCase;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.binarysortable.MyTestClass;
 import org.apache.hadoop.hive.serde2.binarysortable.MyTestInnerStruct;
@@ -114,7 +114,7 @@ public class TestStatsSerde extends Test
         Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
         String st = randField > 6 ? null : TestBinarySortableSerDe
             .getRandString(r);
-	BigDecimal bd = randField > 8 ? null : TestBinarySortableSerDe.getRandBigDecimal(r);
+	HiveDecimal bd = randField > 8 ? null : TestBinarySortableSerDe.getRandHiveDecimal(r);
         MyTestInnerStruct is = randField > 9 ? null : new MyTestInnerStruct(r
             .nextInt(5) - 2, r.nextInt(5) - 2);
         List<Integer> li = randField > 10 ? null : TestBinarySortableSerDe

Modified: hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java (original)
+++ hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java Wed Apr 17 07:29:38 2013
@@ -17,7 +17,8 @@
  */
 package org.apache.hadoop.hive.serde2.binarysortable;
 
-import java.math.BigDecimal;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
+
 import java.util.List;
 
 public class MyTestClass {
@@ -28,7 +29,7 @@ public class MyTestClass {
     Float myFloat;
     Double myDouble;
     String myString;
-    BigDecimal myDecimal;
+    HiveDecimal myDecimal;
     MyTestInnerStruct myStruct;
     List<Integer> myList;
     byte[] myBA;
@@ -37,7 +38,7 @@ public class MyTestClass {
     }
 
     public MyTestClass(Byte b, Short s, Integer i, Long l, Float f, Double d,
-		       String st, BigDecimal bd, MyTestInnerStruct is, List<Integer> li, byte[] ba) {
+		       String st, HiveDecimal bd, MyTestInnerStruct is, List<Integer> li, byte[] ba) {
 	myByte = b;
 	myShort = s;
 	myInt = i;

Modified: hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/TestBinarySortableSerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/TestBinarySortableSerDe.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/TestBinarySortableSerDe.java (original)
+++ hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/TestBinarySortableSerDe.java Wed Apr 17 07:29:38 2013
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.hive.serde2.binarysortable;
 
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -27,6 +26,7 @@ import java.util.Random;
 import junit.framework.TestCase;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.SerDe;
 import org.apache.hadoop.hive.serde2.SerDeUtils;
@@ -135,9 +135,9 @@ public class TestBinarySortableSerDe ext
     }
   }
 
-  public static BigDecimal getRandBigDecimal(Random r) {
+  public static HiveDecimal getRandHiveDecimal(Random r) {
     StringBuilder sb = new StringBuilder();
-    int l1 = 1+r.nextInt(500), l2 = r.nextInt(500);
+    int l1 = 1+r.nextInt(18), l2 = r.nextInt(19);
 
     if (r.nextBoolean()) {
       sb.append("-");
@@ -149,7 +149,7 @@ public class TestBinarySortableSerDe ext
       sb.append(getRandString(r, DECIMAL_CHARS, l2));
     }
 
-    BigDecimal bd = new BigDecimal(sb.toString());
+    HiveDecimal bd = new HiveDecimal(sb.toString());
     return bd;
   }
 
@@ -207,7 +207,7 @@ public class TestBinarySortableSerDe ext
         t.myDouble = randField > 5 ? null : Double
             .valueOf(r.nextDouble() * 10 - 5);
         t.myString = randField > 6 ? null : getRandString(r);
-        t.myDecimal = randField > 7 ? null : getRandBigDecimal(r);
+        t.myDecimal = randField > 7 ? null : getRandHiveDecimal(r);
         t.myStruct = randField > 8 ? null : new MyTestInnerStruct(
             r.nextInt(5) - 2, r.nextInt(5) - 2);
         t.myList = randField > 9 ? null : getRandIntegerArray(r);

Modified: hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassBigger.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassBigger.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassBigger.java (original)
+++ hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassBigger.java Wed Apr 17 07:29:38 2013
@@ -17,10 +17,10 @@
  */
 package org.apache.hadoop.hive.serde2.lazybinary;
 
-import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde2.binarysortable.MyTestInnerStruct;
 
 /**
@@ -35,7 +35,7 @@ public class MyTestClassBigger {
     Float myFloat;
     Double myDouble;
     String myString;
-    BigDecimal myDecimal;
+    HiveDecimal myDecimal;
     MyTestInnerStruct myStruct;
     List<Integer> myList;
     byte[] myBA;
@@ -45,7 +45,7 @@ public class MyTestClassBigger {
     }
 
     public MyTestClassBigger(Byte b, Short s, Integer i, Long l, Float f,
-			     Double d, String st, BigDecimal bd, MyTestInnerStruct is, List<Integer> li,
+			     Double d, String st, HiveDecimal bd, MyTestInnerStruct is, List<Integer> li,
 			     byte[] ba, Map<String, List<MyTestInnerStruct>> mp) {
 	myByte = b;
 	myShort = s;

Modified: hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassSmaller.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassSmaller.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassSmaller.java (original)
+++ hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/MyTestClassSmaller.java Wed Apr 17 07:29:38 2013
@@ -17,7 +17,7 @@
  */
 package org.apache.hadoop.hive.serde2.lazybinary;
 
-import java.math.BigDecimal;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde2.binarysortable.MyTestInnerStruct;
 
 public class MyTestClassSmaller {
@@ -28,14 +28,14 @@ public class MyTestClassSmaller {
     Float myFloat;
     Double myDouble;
     String myString;
-    BigDecimal myDecimal;
+    HiveDecimal myDecimal;
     MyTestInnerStruct myStruct;
 
     public MyTestClassSmaller() {
     }
     
     public MyTestClassSmaller(Byte b, Short s, Integer i, Long l, Float f,
-			      Double d, String st, BigDecimal bd, MyTestInnerStruct is) {
+			      Double d, String st, HiveDecimal bd, MyTestInnerStruct is) {
 	myByte = b;
 	myShort = s;
 	myInt = i;

Modified: hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/TestLazyBinarySerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/TestLazyBinarySerDe.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/TestLazyBinarySerDe.java (original)
+++ hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/TestLazyBinarySerDe.java Wed Apr 17 07:29:38 2013
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.hive.serde2.lazybinary;
 
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -30,6 +29,7 @@ import java.util.Random;
 import junit.framework.TestCase;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.SerDe;
 import org.apache.hadoop.hive.serde2.SerDeUtils;
@@ -201,7 +201,7 @@ public class TestLazyBinarySerDe extends
       Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
       String st = randField > 6 ? null : TestBinarySortableSerDe
           .getRandString(r);
-      BigDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandBigDecimal(r);
+      HiveDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandHiveDecimal(r);
       MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
           .nextInt(5) - 2, r.nextInt(5) - 2);
       List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
@@ -269,7 +269,7 @@ public class TestLazyBinarySerDe extends
       Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
       String st = randField > 6 ? null : TestBinarySortableSerDe
           .getRandString(r);
-      BigDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandBigDecimal(r);
+      HiveDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandHiveDecimal(r);
       MyTestInnerStruct is = randField > 8 ? null : new MyTestInnerStruct(r
           .nextInt(5) - 2, r.nextInt(5) - 2);
       List<Integer> li = randField > 9 ? null : TestBinarySortableSerDe
@@ -325,7 +325,7 @@ public class TestLazyBinarySerDe extends
       Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
       String st = randField > 6 ? null : TestBinarySortableSerDe
           .getRandString(r);
-      BigDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandBigDecimal(r);
+      HiveDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandHiveDecimal(r);
       MyTestInnerStruct is = randField > 8 ? null : new MyTestInnerStruct(r
           .nextInt(5) - 2, r.nextInt(5) - 2);
       List<Integer> li = randField > 9 ? null : TestBinarySortableSerDe
@@ -381,7 +381,7 @@ public class TestLazyBinarySerDe extends
       Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
       String st = randField > 6 ? null : TestBinarySortableSerDe
           .getRandString(r);
-      BigDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandBigDecimal(r);
+      HiveDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandHiveDecimal(r);
       MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
           .nextInt(5) - 2, r.nextInt(5) - 2);
 
@@ -500,7 +500,7 @@ public class TestLazyBinarySerDe extends
         Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
         String st = randField > 6 ? null : TestBinarySortableSerDe
             .getRandString(r);
-        BigDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandBigDecimal(r);      
+        HiveDecimal bd = randField > 7 ? null : TestBinarySortableSerDe.getRandHiveDecimal(r);      
         MyTestInnerStruct is = randField > 8 ? null : new MyTestInnerStruct(r
             .nextInt(5) - 2, r.nextInt(5) - 2);
         List<Integer> li = randField > 9 ? null : TestBinarySortableSerDe

Modified: hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorConverters.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorConverters.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorConverters.java (original)
+++ hive/branches/HIVE-4115/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorConverters.java Wed Apr 17 07:29:38 2013
@@ -19,8 +19,8 @@ package org.apache.hadoop.hive.serde2.ob
 
 import junit.framework.TestCase;
 
-import java.math.BigDecimal;
 
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.serde2.io.ByteWritable;
 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
 import org.apache.hadoop.hive.serde2.io.ShortWritable;
@@ -129,10 +129,10 @@ public class TestObjectInspectorConverte
       assertEquals("TextConverter", new Text("hive"), textConverter
 	  .convert(new String("hive")));
       textConverter = ObjectInspectorConverters.getConverter(
-          PrimitiveObjectInspectorFactory.javaBigDecimalObjectInspector,
+          PrimitiveObjectInspectorFactory.javaHiveDecimalObjectInspector,
           PrimitiveObjectInspectorFactory.writableStringObjectInspector);
       assertEquals("TextConverter", new Text("100.001"), textConverter
-	  .convert(new BigDecimal("100.001")));
+	  .convert(new HiveDecimal("100.001")));
 
       // Binary
       Converter baConverter = ObjectInspectorConverters.getConverter(

Modified: hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/cli/ColumnValue.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/cli/ColumnValue.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/cli/ColumnValue.java (original)
+++ hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/cli/ColumnValue.java Wed Apr 17 07:29:38 2013
@@ -18,9 +18,9 @@
 
 package org.apache.hive.service.cli;
 
-import java.math.BigDecimal;
 import java.sql.Timestamp;
 
+import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hive.service.cli.thrift.TBoolValue;
 import org.apache.hive.service.cli.thrift.TByteValue;
 import org.apache.hive.service.cli.thrift.TColumnValue;
@@ -119,10 +119,10 @@ public class ColumnValue {
     return new ColumnValue(TColumnValue.stringVal(tStringValue));
   }
 
-  public static ColumnValue stringValue(BigDecimal value) {
+  public static ColumnValue stringValue(HiveDecimal value) {
     TStringValue tStrValue = new TStringValue();
     if (value != null) {
-      tStrValue.setValue(((BigDecimal)value).toString());
+      tStrValue.setValue(((HiveDecimal)value).toString());
     }
     return new ColumnValue(TColumnValue.stringVal(tStrValue));
   }
@@ -148,7 +148,7 @@ public class ColumnValue {
     case TIMESTAMP_TYPE:
       return timestampValue((Timestamp)value);
     case DECIMAL_TYPE:
-      return stringValue(((BigDecimal)value));
+      return stringValue(((HiveDecimal)value));
     case BINARY_TYPE:
     case ARRAY_TYPE:
     case MAP_TYPE:

Modified: hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/server/HiveServer2.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/server/HiveServer2.java?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/server/HiveServer2.java (original)
+++ hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/server/HiveServer2.java Wed Apr 17 07:29:38 2013
@@ -81,6 +81,11 @@ public class HiveServer2 extends Composi
 
     HiveStringUtils.startupShutdownMessage(HiveServer2.class, args, LOG);
     try {
+      ServerOptionsProcessor oproc = new ServerOptionsProcessor("hiveserver2");
+      if (!oproc.process(args)) {
+        LOG.fatal("Error starting HiveServer2 with given arguments");
+        System.exit(-1);
+      }
       HiveConf hiveConf = new HiveConf();
       HiveServer2 server = new HiveServer2();
       server.init(hiveConf);

Modified: hive/branches/HIVE-4115/shims/ivy.xml
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/shims/ivy.xml?rev=1468783&r1=1468782&r2=1468783&view=diff
==============================================================================
--- hive/branches/HIVE-4115/shims/ivy.xml (original)
+++ hive/branches/HIVE-4115/shims/ivy.xml Wed Apr 17 07:29:38 2013
@@ -41,10 +41,9 @@
     <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="${jackson.version}"/>
     <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="${jackson.version}"/>
     <dependency org="log4j" name="log4j" rev="${log4j.version}" />
+    <dependency org="com.google.guava" name="guava" rev="${guava.version}" transitive="false"/>
 
     <!-- Hadoop 0.23 dependencies. Used both for shims and for building against Hadoop 0.23. -->
-    <dependency org="com.google.guava" name="guava" rev="${guava-hadoop23.version}"
-                conf="hadoop0.23.shim->default" transitive="false"/>
     <dependency org="org.apache.hadoop" name="hadoop-common"
                 rev="${hadoop-0.23.version}"
                 conf="hadoop0.23.shim->default">
@@ -122,8 +121,6 @@
     </dependency>
 
     <!-- Hadoop 0.20 shim dependencies. Used for building 0.20 shims. -->
-    <dependency org="com.google.guava" name="guava" rev="${guava-hadoop20.version}"
-                conf="hadoop0.20.shim->default" transitive="false"/>
     <dependency org="org.apache.hadoop" name="hadoop-core"
                 rev="${hadoop-0.20.version}"
                 conf="hadoop0.20.shim->default">
@@ -147,8 +144,6 @@
     </dependency>
 
     <!-- Hadoop 0.20S (or 1.0.0) shim dependencies. Used for building 0.20S shims. -->
-    <dependency org="com.google.guava" name="guava" rev="${guava-hadoop20.version}"
-                conf="hadoop0.20S.shim->default" transitive="false"/>
     <dependency org="org.apache.hadoop" name="hadoop-core"
                 rev="${hadoop-0.20S.version}"
                 conf="hadoop0.20S.shim->default">



Mime
View raw message