hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sp...@apache.org
Subject [1/2] hive git commit: Revert "HIVE-9605:Remove parquet nested objects from wrapper writable objects (Sergio Pena, reviewed by Ferdinand Xu)"
Date Wed, 27 May 2015 15:11:07 GMT
Repository: hive
Updated Branches:
  refs/heads/master f078dd427 -> 82c037afe


http://git-wip-us.apache.org/repos/asf/hive/blob/82c037af/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestArrayCompatibility.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestArrayCompatibility.java
b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestArrayCompatibility.java
index 8e386c1..f349aa0 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestArrayCompatibility.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestArrayCompatibility.java
@@ -20,7 +20,11 @@ package org.apache.hadoop.hive.ql.io.parquet;
 
 import java.util.List;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hive.serde2.io.ObjectArrayWritable;
+import org.apache.hadoop.hive.serde2.io.DoubleWritable;
+import org.apache.hadoop.io.ArrayWritable;
+import org.apache.hadoop.io.FloatWritable;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.LongWritable;
 import org.junit.Assert;
 import org.junit.Test;
 import parquet.io.api.RecordConsumer;
@@ -58,10 +62,10 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = list(
-        new Integer(34), new Integer(35), new Integer(36));
+    ArrayWritable expected = record(list(
+        new IntWritable(34), new IntWritable(35), new IntWritable(36)));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -105,11 +109,11 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        record(new Float(1.0f), new Float(1.0f)),
-        record(new Float(2.0f), new Float(2.0f))));
+    ArrayWritable expected = record(list(
+        record(new FloatWritable(1.0f), new FloatWritable(1.0f)),
+        record(new FloatWritable(2.0f), new FloatWritable(2.0f))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -144,10 +148,10 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        new Integer(34), new Integer(35), new Integer(36)));
+    ArrayWritable expected = record(list(
+        new IntWritable(34), new IntWritable(35), new IntWritable(36)));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record", expected, records.get(0));
   }
@@ -194,11 +198,11 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        record(new Long(1234L)),
-        record(new Long(2345L))));
+    ArrayWritable expected = record(list(
+        record(new LongWritable(1234L)),
+        record(new LongWritable(2345L))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -233,10 +237,10 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        new Integer(34), new Integer(35), new Integer(36)));
+    ArrayWritable expected = record(list(
+        new IntWritable(34), new IntWritable(35), new IntWritable(36)));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record", expected, records.get(0));
   }
@@ -283,11 +287,11 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        record(new Long(1234L)),
-        record(new Long(2345L))));
+    ArrayWritable expected = record(list(
+        record(new LongWritable(1234L)),
+        record(new LongWritable(2345L))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -335,11 +339,11 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        new Long(1234L),
-        new Long(2345L)));
+    ArrayWritable expected = record(list(
+        new LongWritable(1234L),
+        new LongWritable(2345L)));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -393,11 +397,11 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        record(new Double(0.0), new Double(0.0)),
-        record(new Double(0.0), new Double(180.0))));
+    ArrayWritable expected = record(list(
+        record(new DoubleWritable(0.0), new DoubleWritable(0.0)),
+        record(new DoubleWritable(0.0), new DoubleWritable(180.0))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -469,12 +473,12 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        record(new Double(0.0), new Double(0.0)),
+    ArrayWritable expected = record(list(
+        record(new DoubleWritable(0.0), new DoubleWritable(0.0)),
         null,
-        record(new Double(0.0), new Double(180.0))));
+        record(new DoubleWritable(0.0), new DoubleWritable(180.0))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -542,11 +546,11 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        record(new Double(0.0), new Double(180.0)),
-        record(new Double(0.0), new Double(0.0))));
+    ArrayWritable expected = record(list(
+        record(new DoubleWritable(0.0), new DoubleWritable(180.0)),
+        record(new DoubleWritable(0.0), new DoubleWritable(0.0))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -615,11 +619,11 @@ public class TestArrayCompatibility extends AbstractTestParquetDirect
{
           }
         });
 
-    ObjectArrayWritable expected = record(list(
-        record(new Double(0.0), new Double(180.0)),
-        record(new Double(0.0), new Double(0.0))));
+    ArrayWritable expected = record(list(
+        record(new DoubleWritable(0.0), new DoubleWritable(180.0)),
+        record(new DoubleWritable(0.0), new DoubleWritable(0.0))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));

http://git-wip-us.apache.org/repos/asf/hive/blob/82c037af/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestDataWritableWriter.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestDataWritableWriter.java
b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestDataWritableWriter.java
index 5f586e4..8f03c5b 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestDataWritableWriter.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestDataWritableWriter.java
@@ -14,18 +14,25 @@
 package org.apache.hadoop.hive.ql.io.parquet;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.ql.io.parquet.serde.ObjectArrayWritableObjectInspector;
+import org.apache.hadoop.hive.ql.io.parquet.serde.ArrayWritableObjectInspector;
 import org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe;
 import org.apache.hadoop.hive.ql.io.parquet.write.DataWritableWriter;
+import org.apache.hadoop.hive.serde2.io.ByteWritable;
+import org.apache.hadoop.hive.serde2.io.ShortWritable;
+import org.apache.hadoop.hive.serde2.io.ParquetHiveRecord;
 import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.SerDeUtils;
-import org.apache.hadoop.hive.serde2.io.ObjectArrayWritable;
-import org.apache.hadoop.hive.serde2.io.ParquetHiveRecord;
+import org.apache.hadoop.hive.serde2.io.DoubleWritable;
 import org.apache.hadoop.hive.serde2.typeinfo.StructTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
+import org.apache.hadoop.io.ArrayWritable;
+import org.apache.hadoop.io.BooleanWritable;
 import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.io.FloatWritable;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Writable;
 import org.junit.Before;
 import org.junit.Test;
@@ -107,38 +114,38 @@ public class TestDataWritableWriter {
 
   private Writable createNull() { return null; }
 
-  private byte createTinyInt(byte value) { return value; }
+  private ByteWritable createTinyInt(byte value) { return new ByteWritable(value); }
 
-  private short createSmallInt(short value) { return value; }
+  private ShortWritable createSmallInt(short value) { return new ShortWritable(value); }
 
-  private long createBigInt(long value) { return value; }
+  private LongWritable createBigInt(long value) { return new LongWritable(value); }
 
-  private int createInt(int value) {
-    return value;
+  private IntWritable createInt(int value) {
+    return new IntWritable(value);
   }
 
-  private float createFloat(float value) {
-    return value;
+  private FloatWritable createFloat(float value) {
+    return new FloatWritable(value);
   }
 
-  private double createDouble(double value) {
-    return value;
+  private DoubleWritable createDouble(double value) {
+    return new DoubleWritable(value);
   }
 
-  private boolean createBoolean(boolean value) {
-    return value;
+  private BooleanWritable createBoolean(boolean value) {
+    return new BooleanWritable(value);
   }
 
   private BytesWritable createString(String value) throws UnsupportedEncodingException {
     return new BytesWritable(value.getBytes("UTF-8"));
   }
 
-  private ObjectArrayWritable createGroup(Object...values) {
-    return new ObjectArrayWritable(values);
+  private ArrayWritable createGroup(Writable...values) {
+    return new ArrayWritable(Writable.class, values);
   }
 
-  private ObjectArrayWritable createArray(Object...values) {
-    return new ObjectArrayWritable(createGroup(values).get());
+  private ArrayWritable createArray(Writable...values) {
+    return new ArrayWritable(Writable.class, createGroup(values).get());
   }
 
   private List<String> createHiveColumnsFrom(final String columnNamesStr) {
@@ -164,15 +171,15 @@ public class TestDataWritableWriter {
     return columnTypes;
   }
 
-  private ObjectArrayWritableObjectInspector getObjectInspector(final String columnNames,
final String columnTypes) {
+  private ArrayWritableObjectInspector getObjectInspector(final String columnNames, final
String columnTypes) {
     List<TypeInfo> columnTypeList = createHiveTypeInfoFrom(columnTypes);
     List<String> columnNameList = createHiveColumnsFrom(columnNames);
     StructTypeInfo rowTypeInfo = (StructTypeInfo) TypeInfoFactory.getStructTypeInfo(columnNameList,
columnTypeList);
 
-    return new ObjectArrayWritableObjectInspector(rowTypeInfo);
+    return new ArrayWritableObjectInspector(rowTypeInfo);
   }
 
-  private ParquetHiveRecord getParquetWritable(String columnNames, String columnTypes, ObjectArrayWritable
record) throws SerDeException {
+  private ParquetHiveRecord getParquetWritable(String columnNames, String columnTypes, ArrayWritable
record) throws SerDeException {
     Properties recordProperties = new Properties();
     recordProperties.setProperty("columns", columnNames);
     recordProperties.setProperty("columns.types", columnTypes);
@@ -205,7 +212,7 @@ public class TestDataWritableWriter {
         + "  optional int64 bigint;\n"
         + "}\n";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createInt(1),
         createDouble(1.0),
         createBoolean(true),
@@ -261,7 +268,7 @@ public class TestDataWritableWriter {
         + "  }\n"
         + "}\n";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createGroup(
             createInt(1),
             createDouble(1.0),
@@ -303,7 +310,7 @@ public class TestDataWritableWriter {
         + "  }\n"
         + "}\n";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createGroup(
             createArray(
                 createInt(1),
@@ -353,7 +360,7 @@ public class TestDataWritableWriter {
         + "  }\n"
         + "}\n";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createGroup(
             createArray(
                 createArray(
@@ -424,7 +431,7 @@ public class TestDataWritableWriter {
         + "  }\n"
         + "}\n";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createGroup(
             createArray(
                 createGroup(
@@ -474,7 +481,7 @@ public class TestDataWritableWriter {
     String columnNames = "structCol";
     String columnTypes = "int";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createInt(1)
     );
 
@@ -497,7 +504,7 @@ public class TestDataWritableWriter {
     String columnNames = "arrayCol";
     String columnTypes = "int";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createInt(1)
     );
 
@@ -522,7 +529,7 @@ public class TestDataWritableWriter {
     String columnNames = "mapCol";
     String columnTypes = "int";
 
-    ObjectArrayWritable hiveRecord = createGroup(
+    ArrayWritable hiveRecord = createGroup(
         createInt(1)
     );
 

http://git-wip-us.apache.org/repos/asf/hive/blob/82c037af/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapStructures.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapStructures.java b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapStructures.java
index 436569a..6fc83e0 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapStructures.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapStructures.java
@@ -22,7 +22,7 @@ import java.util.Arrays;
 import java.util.List;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
-import org.apache.hadoop.hive.serde2.io.ObjectArrayWritable;
+import org.apache.hadoop.io.ArrayWritable;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.Text;
 import org.junit.Assert;
@@ -82,11 +82,11 @@ public class TestMapStructures extends AbstractTestParquetDirect {
           }
         });
 
-    ObjectArrayWritable expected = record(list(
+    ArrayWritable expected = record(list(
         record(new Text("lettuce"), new IntWritable(34)),
         record(new Text("cabbage"), new IntWritable(18))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -149,12 +149,12 @@ public class TestMapStructures extends AbstractTestParquetDirect {
           }
         });
 
-    ObjectArrayWritable expected = record(list(
+    ArrayWritable expected = record(list(
         record(new Text("lettuce"), new IntWritable(34)),
         record(new Text("kale"), null),
         record(new Text("cabbage"), new IntWritable(18))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -230,11 +230,11 @@ public class TestMapStructures extends AbstractTestParquetDirect {
           }
         });
 
-    ObjectArrayWritable expected = record(list(
+    ArrayWritable expected = record(list(
         record(new Text("green"), list(new Text("lettuce"), new Text("kale"), null)),
         record(new Text("brown"), null)));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -325,11 +325,11 @@ public class TestMapStructures extends AbstractTestParquetDirect {
           }
         });
 
-    ObjectArrayWritable expected = record(list(
+    ArrayWritable expected = record(list(
         record(new Text("low"), list(new IntWritable(34), new IntWritable(35), null)),
         record(new Text("high"), list(new IntWritable(340), new IntWritable(360)))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -386,11 +386,11 @@ public class TestMapStructures extends AbstractTestParquetDirect {
           }
         });
 
-    ObjectArrayWritable expected = record(list(record(
+    ArrayWritable expected = record(list(record(
         record(new IntWritable(7), new IntWritable(22)),
         new DoubleWritable(3.14))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -447,11 +447,11 @@ public class TestMapStructures extends AbstractTestParquetDirect {
           }
         });
 
-    ObjectArrayWritable expected = record(list(record(
+    ArrayWritable expected = record(list(record(
         new DoubleWritable(3.14),
         record(new IntWritable(7), new IntWritable(22)))));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));
@@ -542,7 +542,7 @@ public class TestMapStructures extends AbstractTestParquetDirect {
           }
         });
 
-    ObjectArrayWritable expected = record(list(
+    ArrayWritable expected = record(list(
         record(new Text("a"), list(
             record(new Text("b"), new IntWritable(1)))),
         record(new Text("b"), list(
@@ -550,7 +550,7 @@ public class TestMapStructures extends AbstractTestParquetDirect {
             record(new Text("b"), new IntWritable(-2))))
     ));
 
-    List<ObjectArrayWritable> records = read(test);
+    List<ArrayWritable> records = read(test);
     Assert.assertEquals("Should have only one record", 1, records.size());
     assertEquals("Should match expected record",
         expected, records.get(0));

http://git-wip-us.apache.org/repos/asf/hive/blob/82c037af/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapredParquetInputFormat.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapredParquetInputFormat.java
b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapredParquetInputFormat.java
index 1b98cd3..1a54bf5 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapredParquetInputFormat.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestMapredParquetInputFormat.java
@@ -15,7 +15,7 @@ package org.apache.hadoop.hive.ql.io.parquet;
 
 import static org.mockito.Mockito.mock;
 
-import org.apache.hadoop.hive.serde2.io.ObjectArrayWritable;
+import org.apache.hadoop.io.ArrayWritable;
 import org.junit.Test;
 
 import parquet.hadoop.ParquetInputFormat;
@@ -30,7 +30,7 @@ public class TestMapredParquetInputFormat {
   @Test
   public void testConstructorWithParquetInputFormat() {
     new MapredParquetInputFormat(
-        (ParquetInputFormat<ObjectArrayWritable>) mock(ParquetInputFormat.class)
+        (ParquetInputFormat<ArrayWritable>) mock(ParquetInputFormat.class)
         );
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/82c037af/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestParquetRowGroupFilter.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestParquetRowGroupFilter.java
b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestParquetRowGroupFilter.java
index 5f58d4f..4ccb207 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestParquetRowGroupFilter.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/TestParquetRowGroupFilter.java
@@ -22,7 +22,7 @@ import com.google.common.collect.Lists;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.ql.exec.Utilities;
 import org.apache.hadoop.hive.ql.io.parquet.read.ParquetRecordReaderWrapper;
-import org.apache.hadoop.hive.ql.io.parquet.serde.ObjectArrayWritableObjectInspector;
+import org.apache.hadoop.hive.ql.io.parquet.serde.ArrayWritableObjectInspector;
 import org.apache.hadoop.hive.ql.plan.*;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPGreaterThan;
@@ -119,12 +119,12 @@ public class TestParquetRowGroupFilter extends AbstractTestParquetDirect
{
     Assert.assertEquals("row group is not filtered correctly", 0, recordReader.getFiltedBlocks().size());
   }
 
-  private ObjectArrayWritableObjectInspector getObjectInspector(final String columnNames,
final String columnTypes) {
+  private ArrayWritableObjectInspector getObjectInspector(final String columnNames, final
String columnTypes) {
     List<TypeInfo> columnTypeList = createHiveTypeInfoFrom(columnTypes);
     List<String> columnNameList = createHiveColumnsFrom(columnNames);
     StructTypeInfo rowTypeInfo = (StructTypeInfo) TypeInfoFactory.getStructTypeInfo(columnNameList,
columnTypeList);
 
-    return new ObjectArrayWritableObjectInspector(rowTypeInfo);
+    return new ArrayWritableObjectInspector(rowTypeInfo);
   }
 
   private List<String> createHiveColumnsFrom(final String columnNamesStr) {

http://git-wip-us.apache.org/repos/asf/hive/blob/82c037af/serde/src/java/org/apache/hadoop/hive/serde2/io/ObjectArrayWritable.java
----------------------------------------------------------------------
diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/io/ObjectArrayWritable.java b/serde/src/java/org/apache/hadoop/hive/serde2/io/ObjectArrayWritable.java
deleted file mode 100644
index 84faa3c..0000000
--- a/serde/src/java/org/apache/hadoop/hive/serde2/io/ObjectArrayWritable.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed 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.io;
-
-import org.apache.hadoop.io.Writable;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-/**
- * This class is a container of an array of objects of any type. It implements
- * the Writable interface so that it can bypass generic objects read from InputFormat
- * implementations up to Hive object inspectors. This class helps storage formats
- * to avoid Writable objects allocation unnecessary as the only Writable class needed
- * for map/reduce functions is this array of objects.
- *
- * This is the replacement for ArrayWritable class that contains only Writable objects.
- */
-public class ObjectArrayWritable implements Writable {
-  private Object[] values;
-
-  public ObjectArrayWritable(final Object[] values) {
-    this.values = values;
-  }
-
-  public Object[] get() {
-    return values;
-  }
-
-  @Override
-  public void write(DataOutput dataOutput) throws IOException {
-    throw new UnsupportedOperationException("Unsupported method call.");
-  }
-
-  @Override
-  public void readFields(DataInput dataInput) throws IOException {
-    throw new UnsupportedOperationException("Unsupported method call.");
-  }
-}


Mime
View raw message