Repository: hive
Updated Branches:
  refs/heads/branch-1.2 b1c8673ab -> c9fb44f8a


HIVE-10370: Hive does not compile with -Phadoop-1 option (Prasanth Jayachandran 
reviewed by Vaibhav Gumashta)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/c9fb44f8
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/c9fb44f8
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/c9fb44f8

Branch: refs/heads/branch-1.2
Commit: c9fb44f8a6ada50484f6b8de4b4afbda057c5d92
Parents: b1c8673
Author: Prasanth Jayachandran <[email protected]>
Authored: Sun Apr 26 14:01:39 2015 -0700
Committer: Prasanth Jayachandran <[email protected]>
Committed: Sun Apr 26 14:01:39 2015 -0700

----------------------------------------------------------------------
 .../hive/serde2/lazy/TestLazySimpleFast.java    | 22 ++++++++------------
 1 file changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/c9fb44f8/serde/src/test/org/apache/hadoop/hive/serde2/lazy/TestLazySimpleFast.java
----------------------------------------------------------------------
diff --git 
a/serde/src/test/org/apache/hadoop/hive/serde2/lazy/TestLazySimpleFast.java 
b/serde/src/test/org/apache/hadoop/hive/serde2/lazy/TestLazySimpleFast.java
index 46d9f54..951d91a 100644
--- a/serde/src/test/org/apache/hadoop/hive/serde2/lazy/TestLazySimpleFast.java
+++ b/serde/src/test/org/apache/hadoop/hive/serde2/lazy/TestLazySimpleFast.java
@@ -17,39 +17,29 @@
  */
 package org.apache.hadoop.hive.serde2.lazy;
 
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 
-import junit.framework.TestCase;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.ByteStream.Output;
-import org.apache.hadoop.hive.serde2.SerDe;
 import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.SerDeUtils;
 import org.apache.hadoop.hive.serde2.VerifyFast;
 import org.apache.hadoop.hive.serde2.binarysortable.MyTestPrimitiveClass;
 import 
org.apache.hadoop.hive.serde2.binarysortable.MyTestPrimitiveClass.ExtraTypeInfo;
-import 
org.apache.hadoop.hive.serde2.binarysortable.fast.BinarySortableDeserializeRead;
 import org.apache.hadoop.hive.serde2.lazy.fast.LazySimpleDeserializeRead;
 import org.apache.hadoop.hive.serde2.lazy.fast.LazySimpleSerializeWrite;
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
-import 
org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.ObjectInspectorOptions;
 import 
org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
-import 
org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector;
-import 
org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
 import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
-import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
 import org.apache.hadoop.io.BytesWritable;
 import org.apache.hadoop.io.Text;
 
+import junit.framework.TestCase;
+
 public class TestLazySimpleFast extends TestCase {
 
   private void testLazySimpleFast(MyTestPrimitiveClass[] 
myTestPrimitiveClasses, LazySimpleSerDe[] serdes,
@@ -161,7 +151,7 @@ public class TestLazySimpleFast extends TestCase {
       if (!Arrays.equals(bytes1, bytes2)) {
         fail("SerializeWrite and SerDe serialization does not match");
       }
-      serdeBytes[i] = serialized.copyBytes();
+      serdeBytes[i] = copyBytes(serialized);
     }
 
     // Try to deserialize using DeserializeRead our Writable row objects 
created by SerDe.
@@ -186,6 +176,12 @@ public class TestLazySimpleFast extends TestCase {
     }
   }
 
+  private byte[] copyBytes(Text serialized) {
+    byte[] result = new byte[serialized.getLength()];
+    System.arraycopy(serialized.getBytes(), 0, result, 0, 
serialized.getLength());
+    return result;
+  }
+
   private Properties createProperties(String fieldNames, String fieldTypes) {
     Properties tbl = new Properties();
 

Reply via email to