You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2010/01/21 10:45:25 UTC

svn commit: r901621 [1/6] - /hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/

Author: zshao
Date: Thu Jan 21 09:45:20 2010
New Revision: 901621

URL: http://svn.apache.org/viewvc?rev=901621&view=rev
Log:
HIVE-1081. Automated source code cleanup - Part 2 - serde. (Carl Steinbach via zshao)

Modified:
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDe.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeField.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldRequiredness.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldType.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFunction.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeSimpleNode.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStruct.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStructBase.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBase.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBool.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeByte.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeDouble.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeList.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeMap.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeSet.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeString.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypedef.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei16.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei32.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei64.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/JJTthrift_grammarState.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/Node.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/ParseException.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/SimpleCharStream.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/SimpleNode.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/Token.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/TokenMgrError.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/thrift_grammar.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/thrift_grammarConstants.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/thrift_grammarTokenManager.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/thrift_grammarTreeConstants.java

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDe.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDe.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDe.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDe.java Thu Jan 21 09:45:20 2010
@@ -18,27 +18,32 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
+import java.io.ByteArrayInputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+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.serde.Constants;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.ByteStream;
+import org.apache.hadoop.hive.serde2.SerDe;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
-
 import org.apache.hadoop.hive.serde2.thrift.ConfigurableTProtocol;
 import org.apache.hadoop.hive.serde2.thrift.TReflectionUtils;
-
-import java.util.*;
-import java.io.*;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.*;
+import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.util.StringUtils;
-
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.transport.*;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.protocol.TProtocolFactory;
+import org.apache.thrift.transport.TIOStreamTransport;
 
 public class DynamicSerDe implements SerDe, Serializable {
 
@@ -54,30 +59,34 @@
   transient protected ByteStream.Output bos_;
 
   /**
-   * protocols are protected in case any of their properties need to be queried from another
-   * class in this package. For TCTLSeparatedProtocol for example, may want to query the separators.
+   * protocols are protected in case any of their properties need to be queried
+   * from another class in this package. For TCTLSeparatedProtocol for example,
+   * may want to query the separators.
    */
   transient protected TProtocol oprot_;
   transient protected TProtocol iprot_;
 
   TIOStreamTransport tios;
 
-  public void initialize(Configuration job, Properties tbl) throws SerDeException {
+  public void initialize(Configuration job, Properties tbl)
+      throws SerDeException {
     try {
 
       String ddl = tbl.getProperty(Constants.SERIALIZATION_DDL);
       type_name = tbl.getProperty(META_TABLE_NAME);
       String protoName = tbl.getProperty(Constants.SERIALIZATION_FORMAT);
 
-      if(protoName == null) {
+      if (protoName == null) {
         protoName = "org.apache.thrift.protocol.TBinaryProtocol";
       }
       // For backward compatibility
-      protoName = protoName.replace("com.facebook.thrift.protocol", "org.apache.thrift.protocol");
-      TProtocolFactory protFactory = TReflectionUtils.getProtocolFactoryByName(protoName);
+      protoName = protoName.replace("com.facebook.thrift.protocol",
+          "org.apache.thrift.protocol");
+      TProtocolFactory protFactory = TReflectionUtils
+          .getProtocolFactoryByName(protoName);
       bos_ = new ByteStream.Output();
       bis_ = new ByteStream.Input();
-      tios = new TIOStreamTransport(bis_,bos_);
+      tios = new TIOStreamTransport(bis_, bos_);
 
       oprot_ = protFactory.getProtocol(tios);
       iprot_ = protFactory.getProtocol(tios);
@@ -86,32 +95,34 @@
        * initialize the protocols
        */
 
-      if(oprot_ instanceof org.apache.hadoop.hive.serde2.thrift.ConfigurableTProtocol) {
-        ((ConfigurableTProtocol)oprot_).initialize(job, tbl);
+      if (oprot_ instanceof org.apache.hadoop.hive.serde2.thrift.ConfigurableTProtocol) {
+        ((ConfigurableTProtocol) oprot_).initialize(job, tbl);
       }
 
-      if(iprot_ instanceof org.apache.hadoop.hive.serde2.thrift.ConfigurableTProtocol) {
-        ((ConfigurableTProtocol)iprot_).initialize(job, tbl);
+      if (iprot_ instanceof org.apache.hadoop.hive.serde2.thrift.ConfigurableTProtocol) {
+        ((ConfigurableTProtocol) iprot_).initialize(job, tbl);
       }
 
       // in theory the include path should come from the configuration
       List<String> include_path = new ArrayList<String>();
       include_path.add(".");
       LOG.debug("ddl=" + ddl);
-      this.parse_tree = new thrift_grammar(new ByteArrayInputStream(ddl.getBytes()), include_path,false);
-      this.parse_tree.Start();
+      parse_tree = new thrift_grammar(new ByteArrayInputStream(ddl.getBytes()),
+          include_path, false);
+      parse_tree.Start();
 
-      this.bt = (DynamicSerDeStructBase)this.parse_tree.types.get(type_name);
+      bt = (DynamicSerDeStructBase) parse_tree.types.get(type_name);
 
-      if(this.bt == null) {
-        this.bt = (DynamicSerDeStructBase)this.parse_tree.tables.get(type_name);
+      if (bt == null) {
+        bt = (DynamicSerDeStructBase) parse_tree.tables.get(type_name);
       }
 
-      if(this.bt == null) {
-        throw new SerDeException("Could not lookup table type " + type_name + " in this ddl: " + ddl);
+      if (bt == null) {
+        throw new SerDeException("Could not lookup table type " + type_name
+            + " in this ddl: " + ddl);
       }
 
-      this.bt.initialize();
+      bt.initialize();
     } catch (Exception e) {
       System.err.println(StringUtils.stringifyException(e));
       throw new SerDeException(e);
@@ -119,53 +130,59 @@
   }
 
   Object deserializeReuse = null;
+
   public Object deserialize(Writable field) throws SerDeException {
     try {
       if (field instanceof Text) {
-        Text b = (Text)field;
+        Text b = (Text) field;
         bis_.reset(b.getBytes(), b.getLength());
       } else {
-        BytesWritable b = (BytesWritable)field;
+        BytesWritable b = (BytesWritable) field;
         bis_.reset(b.get(), b.getSize());
       }
-      deserializeReuse = this.bt.deserialize(deserializeReuse, iprot_);
+      deserializeReuse = bt.deserialize(deserializeReuse, iprot_);
       return deserializeReuse;
-    } catch(Exception e) {
+    } catch (Exception e) {
       e.printStackTrace();
       throw new SerDeException(e);
     }
   }
 
-  public static ObjectInspector dynamicSerDeStructBaseToObjectInspector(DynamicSerDeTypeBase bt) throws SerDeException {
+  public static ObjectInspector dynamicSerDeStructBaseToObjectInspector(
+      DynamicSerDeTypeBase bt) throws SerDeException {
     if (bt.isList()) {
-      return ObjectInspectorFactory.getStandardListObjectInspector(
-          dynamicSerDeStructBaseToObjectInspector(((DynamicSerDeTypeList)bt).getElementType()));
+      return ObjectInspectorFactory
+          .getStandardListObjectInspector(dynamicSerDeStructBaseToObjectInspector(((DynamicSerDeTypeList) bt)
+              .getElementType()));
     } else if (bt.isMap()) {
-      DynamicSerDeTypeMap btMap = (DynamicSerDeTypeMap)bt; 
+      DynamicSerDeTypeMap btMap = (DynamicSerDeTypeMap) bt;
       return ObjectInspectorFactory.getStandardMapObjectInspector(
-          dynamicSerDeStructBaseToObjectInspector(btMap.getKeyType()), 
+          dynamicSerDeStructBaseToObjectInspector(btMap.getKeyType()),
           dynamicSerDeStructBaseToObjectInspector(btMap.getValueType()));
     } else if (bt.isPrimitive()) {
-      return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(
-          PrimitiveObjectInspectorUtils.getTypeEntryFromPrimitiveJavaClass(bt.getRealType()).primitiveCategory);
+      return PrimitiveObjectInspectorFactory
+          .getPrimitiveJavaObjectInspector(PrimitiveObjectInspectorUtils
+              .getTypeEntryFromPrimitiveJavaClass(bt.getRealType()).primitiveCategory);
     } else {
       // Must be a struct
-      DynamicSerDeStructBase btStruct = (DynamicSerDeStructBase)bt;
+      DynamicSerDeStructBase btStruct = (DynamicSerDeStructBase) bt;
       DynamicSerDeFieldList fieldList = btStruct.getFieldList();
       DynamicSerDeField[] fields = fieldList.getChildren();
-      ArrayList<String> fieldNames = new ArrayList<String>(fields.length); 
-      ArrayList<ObjectInspector> fieldObjectInspectors = new ArrayList<ObjectInspector>(fields.length); 
-      for(int i=0; i<fields.length; i++) {
-        fieldNames.add(fields[i].name);
-        fieldObjectInspectors.add(
-            dynamicSerDeStructBaseToObjectInspector(fields[i].getFieldType().getMyType()));
+      ArrayList<String> fieldNames = new ArrayList<String>(fields.length);
+      ArrayList<ObjectInspector> fieldObjectInspectors = new ArrayList<ObjectInspector>(
+          fields.length);
+      for (DynamicSerDeField field : fields) {
+        fieldNames.add(field.name);
+        fieldObjectInspectors.add(dynamicSerDeStructBaseToObjectInspector(field
+            .getFieldType().getMyType()));
       }
-      return ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldObjectInspectors);
+      return ObjectInspectorFactory.getStandardStructObjectInspector(
+          fieldNames, fieldObjectInspectors);
     }
   }
 
   public ObjectInspector getObjectInspector() throws SerDeException {
-    return dynamicSerDeStructBaseToObjectInspector(this.bt);
+    return dynamicSerDeStructBaseToObjectInspector(bt);
   }
 
   public Class<? extends Writable> getSerializedClass() {
@@ -173,17 +190,18 @@
   }
 
   BytesWritable ret = new BytesWritable();
+
   public Writable serialize(Object obj, ObjectInspector objInspector)
-  throws SerDeException {
+      throws SerDeException {
     try {
       bos_.reset();
-      this.bt.serialize(obj, objInspector, oprot_);
+      bt.serialize(obj, objInspector, oprot_);
       oprot_.getTransport().flush();
-    } catch(Exception e) {
+    } catch (Exception e) {
       e.printStackTrace();
       throw new SerDeException(e);
     }
-    ret.set(bos_.getData(),0,bos_.getCount());
+    ret.set(bos_.getData(), 0, bos_.getCount());
     return ret;
   }
 }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeField.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeField.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeField.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeField.java Thu Jan 21 09:45:20 2010
@@ -18,34 +18,31 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.hadoop.hive.serde2.*;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TProtocol;
 
 public class DynamicSerDeField extends DynamicSerDeSimpleNode {
 
-
   // production is:
-  // [this.fieldid :] Requiredness() FieldType() this.name FieldValue() [CommaOrSemicolon()]
+  // [this.fieldid :] Requiredness() FieldType() this.name FieldValue()
+  // [CommaOrSemicolon()]
 
   private final int FD_REQUIREDNESS = 0;
   private final int FD_FIELD_TYPE = 1;
-  private final int FD_FIELD_VALUE =2;
 
   public boolean isSkippable() {
-    return ((DynamicSerDeFieldRequiredness)this.jjtGetChild(FD_REQUIREDNESS)).getRequiredness() == DynamicSerDeFieldRequiredness.RequirednessTypes.Skippable;
+    return ((DynamicSerDeFieldRequiredness) jjtGetChild(FD_REQUIREDNESS))
+        .getRequiredness() == DynamicSerDeFieldRequiredness.RequirednessTypes.Skippable;
   }
 
   public DynamicSerDeFieldType getFieldType() {
-    return (DynamicSerDeFieldType)this.jjtGetChild(FD_FIELD_TYPE);
+    return (DynamicSerDeFieldType) jjtGetChild(FD_FIELD_TYPE);
   }
 
   public DynamicSerDeField(int i) {
     super(i);
   }
+
   public DynamicSerDeField(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
 }
-

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java Thu Jan 21 09:45:20 2010
@@ -18,82 +18,85 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.StructField;
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
-
-import java.lang.reflect.*;
-import org.apache.thrift.protocol.TType.*;
-
-public class DynamicSerDeFieldList extends DynamicSerDeSimpleNode implements Serializable {
-
-  //  private void writeObject(ObjectOutputStream out) throws IOException {
-  //    out.writeObject(types_by_column_name);
-  //    out.writeObject(ordered_types);
-  //  }
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TField;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.protocol.TProtocolUtil;
+import org.apache.thrift.protocol.TType;
+
+public class DynamicSerDeFieldList extends DynamicSerDeSimpleNode implements
+    Serializable {
+
+  // private void writeObject(ObjectOutputStream out) throws IOException {
+  // out.writeObject(types_by_column_name);
+  // out.writeObject(ordered_types);
+  // }
 
   // production: Field()*
 
   // mapping of the fieldid to the field
-  private Map<Integer,DynamicSerDeTypeBase> types_by_id = null;
-  private Map<String,DynamicSerDeTypeBase> types_by_column_name = null;
+  private Map<Integer, DynamicSerDeTypeBase> types_by_id = null;
+  private Map<String, DynamicSerDeTypeBase> types_by_column_name = null;
   private DynamicSerDeTypeBase ordered_types[] = null;
 
-  private Map<String,Integer> ordered_column_id_by_name = null;
+  private Map<String, Integer> ordered_column_id_by_name = null;
 
   public DynamicSerDeFieldList(int i) {
     super(i);
   }
 
   public DynamicSerDeFieldList(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   private DynamicSerDeField getField(int i) {
-    return (DynamicSerDeField)this.jjtGetChild(i);
+    return (DynamicSerDeField) jjtGetChild(i);
   }
 
-  final public DynamicSerDeField [] getChildren() {
-    int size = this.jjtGetNumChildren();
-    DynamicSerDeField result [] = new DynamicSerDeField[size];
-    for(int i = 0; i < size; i++) {
-      result[i] = (DynamicSerDeField)this.jjtGetChild(i);
+  final public DynamicSerDeField[] getChildren() {
+    int size = jjtGetNumChildren();
+    DynamicSerDeField result[] = new DynamicSerDeField[size];
+    for (int i = 0; i < size; i++) {
+      result[i] = (DynamicSerDeField) jjtGetChild(i);
     }
     return result;
   }
 
   private int getNumFields() {
-    return this.jjtGetNumChildren();
+    return jjtGetNumChildren();
   }
 
   public void initialize() {
-    if(types_by_id == null) {
+    if (types_by_id == null) {
       // multiple means of lookup
-      types_by_id = new HashMap<Integer, DynamicSerDeTypeBase> ();
-      types_by_column_name = new HashMap<String, DynamicSerDeTypeBase> ();
-      ordered_types = new DynamicSerDeTypeBase[this.jjtGetNumChildren()];
+      types_by_id = new HashMap<Integer, DynamicSerDeTypeBase>();
+      types_by_column_name = new HashMap<String, DynamicSerDeTypeBase>();
+      ordered_types = new DynamicSerDeTypeBase[jjtGetNumChildren()];
       ordered_column_id_by_name = new HashMap<String, Integer>();
 
       // put them in and also roll them up while we're at it
       // a Field contains a FieldType which in turn contains a type
-      for(int i = 0 ; i < this.jjtGetNumChildren(); i++) {
-        DynamicSerDeField mt = this.getField(i);
+      for (int i = 0; i < jjtGetNumChildren(); i++) {
+        DynamicSerDeField mt = getField(i);
         DynamicSerDeTypeBase type = mt.getFieldType().getMyType();
-        // types get initialized in case they need to setup any 
+        // types get initialized in case they need to setup any
         // internal data structures - e.g., DynamicSerDeStructBase
         type.initialize();
         type.fieldid = mt.fieldid;
         type.name = mt.name;
 
-        types_by_id.put(Integer.valueOf(mt.fieldid) , type);
+        types_by_id.put(Integer.valueOf(mt.fieldid), type);
         types_by_column_name.put(mt.name, type);
         ordered_types[i] = type;
         ordered_column_id_by_name.put(mt.name, i);
@@ -110,27 +113,28 @@
   }
 
   /**
-   * Indicates whether fields can be out of order or missing. i.e., is it really real
-   * thrift serialization.
-   * This is used by dynamicserde to do some optimizations if it knows all the fields exist
-   * and are required and are serialized in order.
-   * For now, those optimizations are only done for DynamicSerDe serialized data so always
-   * set to false for now.
+   * Indicates whether fields can be out of order or missing. i.e., is it really
+   * real thrift serialization. This is used by dynamicserde to do some
+   * optimizations if it knows all the fields exist and are required and are
+   * serialized in order. For now, those optimizations are only done for
+   * DynamicSerDe serialized data so always set to false for now.
    */
   protected boolean isRealThrift = false;
 
-  protected boolean[] fieldsPresent; 
-  public Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  protected boolean[] fieldsPresent;
+
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     ArrayList<Object> struct = null;
 
     if (reuse == null) {
-      struct = new ArrayList<Object>(this.getNumFields());
-      for(int i=0; i<ordered_types.length; i++) {
+      struct = new ArrayList<Object>(getNumFields());
+      for (DynamicSerDeTypeBase orderedType : ordered_types) {
         struct.add(null);
       }
     } else {
       struct = (ArrayList<Object>) reuse;
-      assert(struct.size() == ordered_types.length);
+      assert (struct.size() == ordered_types.length);
     }
 
     boolean fastSkips = iprot instanceof org.apache.hadoop.hive.serde2.thrift.SkippableTProtocol;
@@ -144,17 +148,19 @@
     Arrays.fill(fieldsPresent, false);
 
     // Read the fields.
-    for(int i = 0; i < this.getNumFields(); i++) {
+    for (int i = 0; i < getNumFields(); i++) {
       DynamicSerDeTypeBase mt = null;
       TField field = null;
-      
-      if(!isRealThrift && this.getField(i).isSkippable()) {
-        // PRE - all the fields are required and serialized in order - is !isRealThrift
-        mt = this.ordered_types[i];
-        if(fastSkips) {
-          ((org.apache.hadoop.hive.serde2.thrift.SkippableTProtocol)iprot).skip(mt.getType());
+
+      if (!isRealThrift && getField(i).isSkippable()) {
+        // PRE - all the fields are required and serialized in order - is
+        // !isRealThrift
+        mt = ordered_types[i];
+        if (fastSkips) {
+          ((org.apache.hadoop.hive.serde2.thrift.SkippableTProtocol) iprot)
+              .skip(mt.getType());
         } else {
-          TProtocolUtil.skip(iprot,mt.getType());
+          TProtocolUtil.skip(iprot, mt.getType());
         }
         struct.set(i, null);
         continue;
@@ -162,104 +168,118 @@
       if (thrift_mode) {
         field = iprot.readFieldBegin();
 
-        if(field.type >= 0) {
-          if(field.type == TType.STOP) {
+        if (field.type >= 0) {
+          if (field.type == TType.STOP) {
             stopSeen = true;
             break;
           }
-          mt = this.getFieldByFieldId(field.id);
-          if(mt == null) {
-            System.err.println("ERROR for fieldid: " + field.id + " system has no knowledge of this field which is of type : " + field.type);
-            TProtocolUtil.skip(iprot,field.type);
+          mt = getFieldByFieldId(field.id);
+          if (mt == null) {
+            System.err.println("ERROR for fieldid: " + field.id
+                + " system has no knowledge of this field which is of type : "
+                + field.type);
+            TProtocolUtil.skip(iprot, field.type);
             continue;
           }
         }
       }
 
-      // field.type < 0 means that this is a faked Thrift field, e.g., TControlSeparatedProtocol, which does not
-      // serialize the field id in the stream.  As a result, the only way to get the field id is to fall back to 
+      // field.type < 0 means that this is a faked Thrift field, e.g.,
+      // TControlSeparatedProtocol, which does not
+      // serialize the field id in the stream. As a result, the only way to get
+      // the field id is to fall back to
       // the position "i".
-      // The intention of this hack (field.type < 0) is to make TControlSeparatedProtocol a real Thrift prototype,
-      // but there are a lot additional work to do to fulfill that, and that protocol inherently does not support
+      // The intention of this hack (field.type < 0) is to make
+      // TControlSeparatedProtocol a real Thrift prototype,
+      // but there are a lot additional work to do to fulfill that, and that
+      // protocol inherently does not support
       // versioning (adding/deleting fields).
       int orderedId = -1;
       if (!thrift_mode || field.type < 0) {
-        mt = this.ordered_types[i];
-        // We don't need to lookup order_column_id_by_name because we know it must be "i".
+        mt = ordered_types[i];
+        // We don't need to lookup order_column_id_by_name because we know it
+        // must be "i".
         orderedId = i;
       } else {
         // Set the correct position
-        orderedId = ordered_column_id_by_name.get(mt.name); 
+        orderedId = ordered_column_id_by_name.get(mt.name);
       }
       struct.set(orderedId, mt.deserialize(struct.get(orderedId), iprot));
-      if(thrift_mode) {
+      if (thrift_mode) {
         iprot.readFieldEnd();
       }
       fieldsPresent[orderedId] = true;
     }
-    
-    for(int i = 0; i < ordered_types.length; i++) {
+
+    for (int i = 0; i < ordered_types.length; i++) {
       if (!fieldsPresent[i]) {
         struct.set(i, null);
       }
     }
-    
-    if(thrift_mode && !stopSeen) {
-      // strip off the STOP marker, which may be left if all the fields were in the serialization
+
+    if (thrift_mode && !stopSeen) {
+      // strip off the STOP marker, which may be left if all the fields were in
+      // the serialization
       iprot.readFieldBegin();
     }
     return struct;
   }
 
-  
   TField field = new TField();
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
-    // Assuming the ObjectInspector represents exactly the same type as this struct.
+
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
+    // Assuming the ObjectInspector represents exactly the same type as this
+    // struct.
     // This assumption should be checked during query compile time.
-    assert(oi instanceof StructObjectInspector);
+    assert (oi instanceof StructObjectInspector);
     StructObjectInspector soi = (StructObjectInspector) oi;
 
     boolean writeNulls = oprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol;
-    
+
     // For every field
     List<? extends StructField> fields = soi.getAllStructFieldRefs();
     if (fields.size() != ordered_types.length) {
-      throw new SerDeException("Trying to serialize " + fields.size() 
-          + " fields into a struct with " + ordered_types.length
-          + " object=" + o + " objectinspector=" + oi.getTypeName());
+      throw new SerDeException("Trying to serialize " + fields.size()
+          + " fields into a struct with " + ordered_types.length + " object="
+          + o + " objectinspector=" + oi.getTypeName());
     }
-    for (int i=0; i<fields.size(); i++) {
+    for (int i = 0; i < fields.size(); i++) {
       Object f = soi.getStructFieldData(o, fields.get(i));
       DynamicSerDeTypeBase mt = ordered_types[i];
-      
+
       if (f == null && !writeNulls) {
         continue;
       }
 
-      if(thrift_mode) {
-        field = new TField(mt.name, mt.getType(), (short)mt.fieldid);
+      if (thrift_mode) {
+        field = new TField(mt.name, mt.getType(), (short) mt.fieldid);
         oprot.writeFieldBegin(field);
       }
 
-      if(f == null) {
-        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)oprot).writeNull();
+      if (f == null) {
+        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) oprot)
+            .writeNull();
       } else {
         mt.serialize(f, fields.get(i).getFieldObjectInspector(), oprot);
       }
-      if(thrift_mode) {
+      if (thrift_mode) {
         oprot.writeFieldEnd();
       }
     }
-    if(thrift_mode) {
+    if (thrift_mode) {
       oprot.writeFieldStop();
     }
   }
 
+  @Override
   public String toString() {
     StringBuffer result = new StringBuffer();
     String prefix = "";
-    for(DynamicSerDeField t: this.getChildren()) {
-      result.append(prefix + t.fieldid + ":" + t.getFieldType().getMyType().toString() + " " + t.name);
+    for (DynamicSerDeField t : getChildren()) {
+      result.append(prefix + t.fieldid + ":"
+          + t.getFieldType().getMyType().toString() + " " + t.name);
       prefix = ",";
     }
     return result.toString();

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldRequiredness.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldRequiredness.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldRequiredness.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldRequiredness.java Thu Jan 21 09:45:20 2010
@@ -19,14 +19,13 @@
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
 public class DynamicSerDeFieldRequiredness extends SimpleNode {
-  public enum RequirednessTypes 
-  {
-    Required,  Skippable, Optional,
-      };
+  public enum RequirednessTypes {
+    Required, Skippable, Optional,
+  };
 
   /**
-   *  Is this a required, skippable or optional field.
-   *  Used by DynamicSerDe for optimizations.
+   * Is this a required, skippable or optional field. Used by DynamicSerDe for
+   * optimizations.
    */
   protected RequirednessTypes requiredness;
 

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldType.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldType.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldType.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldType.java Thu Jan 21 09:45:20 2010
@@ -24,17 +24,21 @@
   // production: this.name | BaseType() | MapType() | SetType() | ListType()
 
   private final int FD_FIELD_TYPE = 0;
+
   public DynamicSerDeFieldType(int i) {
     super(i);
   }
+
   public DynamicSerDeFieldType(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   protected DynamicSerDeTypeBase getMyType() {
-    // bugbug, need to deal with a named type here - i.e., look it up and proxy to it
-    // should raise an exception if this is a typedef since won't be any children
+    // bugbug, need to deal with a named type here - i.e., look it up and proxy
+    // to it
+    // should raise an exception if this is a typedef since won't be any
+    // children
     // and thus we can quickly find this comment and limitation.
-    return (DynamicSerDeTypeBase)this.jjtGetChild(FD_FIELD_TYPE);
+    return (DynamicSerDeTypeBase) jjtGetChild(FD_FIELD_TYPE);
   }
 }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFunction.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFunction.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFunction.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFunction.java Thu Jan 21 09:45:20 2010
@@ -22,31 +22,33 @@
 
 public class DynamicSerDeFunction extends DynamicSerDeStructBase {
 
-  // production is: Async() FunctionType() NAME FieldList() Throws() [CommaOrSemicolon]
+  // production is: Async() FunctionType() NAME FieldList() Throws()
+  // [CommaOrSemicolon]
 
-  private final int FD_ASYNC = 0;
-  private final int FD_FUNCTION_TYPE = 1;
   private final int FD_FIELD_LIST = 2;
-  private final int FD_THROWS = 3;
 
   public DynamicSerDeFunction(int i) {
     super(i);
   }
+
   public DynamicSerDeFunction(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
+  @Override
   public DynamicSerDeFieldList getFieldList() {
-    return (DynamicSerDeFieldList)this.jjtGetChild(FD_FIELD_LIST);
+    return (DynamicSerDeFieldList) jjtGetChild(FD_FIELD_LIST);
   }
 
+  @Override
   public String toString() {
-    String result = "function " + this.name + " (";
-    result += this.getFieldList().toString();
+    String result = "function " + name + " (";
+    result += getFieldList().toString();
     result += ")";
     return result;
   }
 
+  @Override
   public byte getType() {
     return TMessageType.CALL;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeSimpleNode.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeSimpleNode.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeSimpleNode.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeSimpleNode.java Thu Jan 21 09:45:20 2010
@@ -20,12 +20,15 @@
 
 public class DynamicSerDeSimpleNode extends SimpleNode {
   protected static final boolean thrift_mode = true;
+
   public DynamicSerDeSimpleNode(int i) {
     super(i);
   }
+
   public DynamicSerDeSimpleNode(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
+
   protected int fieldid;
   protected String name;
 }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStruct.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStruct.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStruct.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStruct.java Thu Jan 21 09:45:20 2010
@@ -29,21 +29,25 @@
   public DynamicSerDeStruct(int i) {
     super(i);
   }
+
   public DynamicSerDeStruct(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
+  @Override
   public String toString() {
-    String result = "struct " + this.name + "(";
-    result += this.getFieldList().toString();
+    String result = "struct " + name + "(";
+    result += getFieldList().toString();
     result += ")";
     return result;
   }
 
+  @Override
   public DynamicSerDeFieldList getFieldList() {
-    return (DynamicSerDeFieldList)this.jjtGetChild(FD_FIELD_LIST);
+    return (DynamicSerDeFieldList) jjtGetChild(FD_FIELD_LIST);
   }
 
+  @Override
   public byte getType() {
     return TType.STRUCT;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStructBase.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStructBase.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStructBase.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeStructBase.java Thu Jan 21 09:45:20 2010
@@ -18,47 +18,56 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.*;
-import java.io.*;
+import java.io.Serializable;
 import java.util.List;
 
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.protocol.TStruct;
 
-abstract public class DynamicSerDeStructBase extends DynamicSerDeTypeBase implements Serializable {
+abstract public class DynamicSerDeStructBase extends DynamicSerDeTypeBase
+    implements Serializable {
 
   DynamicSerDeFieldList fieldList;
 
   public DynamicSerDeStructBase(int i) {
     super(i);
   }
+
   public DynamicSerDeStructBase(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   abstract public DynamicSerDeFieldList getFieldList();
 
+  @Override
   public void initialize() {
     fieldList = getFieldList();
     fieldList.initialize();
   }
 
-  public boolean isPrimitive() { return false; }
-
+  @Override
+  public boolean isPrimitive() {
+    return false;
+  }
 
+  @Override
   public Class getRealType() {
     return List.class;
   }
 
-  public Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
-    if(thrift_mode) {
+  @Override
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
+    if (thrift_mode) {
       iprot.readStructBegin();
     }
 
     Object o = fieldList.deserialize(reuse, iprot);
 
-    if(thrift_mode) {
+    if (thrift_mode) {
       iprot.readStructEnd();
     }
     return o;
@@ -66,21 +75,27 @@
 
   /**
    * serialize
-   *
-   * The way to serialize a Thrift "table" which in thrift land is really a function and thus this class's name.
-   *
-   * @param o - this list should be in the order of the function's params for now. If we wanted to remove this requirement,
-   * we'd need to make it a List<Pair<String, Object>> with the String being the field name.
-   *
+   * 
+   * The way to serialize a Thrift "table" which in thrift land is really a
+   * function and thus this class's name.
+   * 
+   * @param o
+   *          - this list should be in the order of the function's params for
+   *          now. If we wanted to remove this requirement, we'd need to make it
+   *          a List<Pair<String, Object>> with the String being the field name.
+   * 
    */
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
-    if(thrift_mode) {
-      oprot.writeStructBegin(new TStruct(this.name));
+  @Override
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
+    if (thrift_mode) {
+      oprot.writeStructBegin(new TStruct(name));
     }
 
     fieldList.serialize(o, oi, oprot);
 
-    if(thrift_mode) {
+    if (thrift_mode) {
       oprot.writeStructEnd();
     }
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBase.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBase.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBase.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBase.java Thu Jan 21 09:45:20 2010
@@ -18,14 +18,15 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.hadoop.hive.serde2.*;
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import java.io.Serializable;
 
-import org.apache.thrift.protocol.TProtocol;
+import org.apache.hadoop.hive.serde2.SerDeException;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.thrift.TException;
-import java.io.Serializable;
+import org.apache.thrift.protocol.TProtocol;
 
-public abstract class DynamicSerDeTypeBase extends DynamicSerDeSimpleNode implements Serializable {
+public abstract class DynamicSerDeTypeBase extends DynamicSerDeSimpleNode
+    implements Serializable {
   private static final long serialVersionUID = 1L;
 
   public DynamicSerDeTypeBase(int i) {
@@ -33,11 +34,12 @@
   }
 
   public DynamicSerDeTypeBase(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   public void initialize() {
-    // for base type, do nothing. Other types, like structs may initialize internal data
+    // for base type, do nothing. Other types, like structs may initialize
+    // internal data
     // structures.
   }
 
@@ -49,10 +51,14 @@
     throw new RuntimeException("Not implemented in base");
   }
 
-  public abstract Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException;
+  public abstract Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException;
 
-  public abstract void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException;
+  public abstract void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException;
 
+  @Override
   public String toString() {
     return "BAD";
   }
@@ -61,8 +67,16 @@
     return -1;
   }
 
-  public boolean isPrimitive() { return true; }
-  public boolean isList() { return false; }
-  public boolean isMap() { return false; }
+  public boolean isPrimitive() {
+    return true;
+  }
+
+  public boolean isList() {
+    return false;
+  }
+
+  public boolean isMap() {
+    return false;
+  }
 
 }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBool.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBool.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBool.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeBool.java Thu Jan 21 09:45:20 2010
@@ -18,13 +18,11 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
-
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypeBool extends DynamicSerDeTypeBase {
@@ -39,6 +37,7 @@
     super(p, i);
   }
 
+  @Override
   public String toString() {
     return "bool";
   }
@@ -47,8 +46,10 @@
   public Object deserialize(Object reuse, TProtocol iprot)
       throws SerDeException, TException, IllegalAccessException {
     boolean val = iprot.readBool();
-    if (val == false && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol && 
-        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)iprot).lastPrimitiveWasNull()) {
+    if (val == false
+        && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol
+        && ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) iprot)
+            .lastPrimitiveWasNull()) {
       return null;
     }
     return Boolean.valueOf(val);
@@ -62,11 +63,18 @@
     oprot.writeBool(poi.get(o));
   }
 
+  @Override
   public byte getType() {
     return TType.BOOL;
   }
-  
-  public Class getRealType() { return java.lang.Boolean.class; }
-  public Boolean getRealTypeInstance() { return Boolean.FALSE; }
-  
+
+  @Override
+  public Class getRealType() {
+    return java.lang.Boolean.class;
+  }
+
+  public Boolean getRealTypeInstance() {
+    return Boolean.FALSE;
+  }
+
 }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeByte.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeByte.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeByte.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeByte.java Thu Jan 21 09:45:20 2010
@@ -18,47 +18,57 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ByteObjectInspector;
-
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypeByte extends DynamicSerDeTypeBase {
 
   // production is: byte
 
-
   public DynamicSerDeTypeByte(int i) {
     super(i);
   }
+
   public DynamicSerDeTypeByte(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
-  public String toString() { return "byte"; }
+  @Override
+  public String toString() {
+    return "byte";
+  }
 
-  public Byte deserialize(TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  public Byte deserialize(TProtocol iprot) throws SerDeException, TException,
+      IllegalAccessException {
     byte val = iprot.readByte();
-    if (val == 0 && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol && 
-        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)iprot).lastPrimitiveWasNull()) {
+    if (val == 0
+        && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol
+        && ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) iprot)
+            .lastPrimitiveWasNull()) {
       return null;
     }
     return Byte.valueOf(val);
   }
-  public Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+
+  @Override
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     return deserialize(iprot);
   }
 
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
+  @Override
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
     ByteObjectInspector poi = (ByteObjectInspector) oi;
     oprot.writeByte(poi.get(o));
   }
 
+  @Override
   public byte getType() {
     return TType.BYTE;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeDouble.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeDouble.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeDouble.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeDouble.java Thu Jan 21 09:45:20 2010
@@ -18,19 +18,11 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector;
-
-import java.lang.reflect.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypeDouble extends DynamicSerDeTypeBase {
@@ -40,30 +32,48 @@
   public DynamicSerDeTypeDouble(int i) {
     super(i);
   }
+
   public DynamicSerDeTypeDouble(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
-  public String toString() { return "double"; }
+  @Override
+  public String toString() {
+    return "double";
+  }
 
-  public Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  @Override
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     double val = iprot.readDouble();
-    if (val == 0 && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol && 
-        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)iprot).lastPrimitiveWasNull()) {
+    if (val == 0
+        && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol
+        && ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) iprot)
+            .lastPrimitiveWasNull()) {
       return null;
     }
     return Double.valueOf(val);
   }
 
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
+  @Override
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
     DoubleObjectInspector poi = (DoubleObjectInspector) oi;
     oprot.writeDouble(poi.get(o));
   }
 
+  @Override
   public byte getType() {
     return TType.DOUBLE;
   }
-  
-  public Class getRealType() { return java.lang.Double.class; }
-  public Double getRealTypeInstance() { return Double.valueOf(0); }
+
+  @Override
+  public Class getRealType() {
+    return java.lang.Double.class;
+  }
+
+  public Double getRealTypeInstance() {
+    return Double.valueOf(0);
+  }
 }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeList.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeList.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeList.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeList.java Thu Jan 21 09:45:20 2010
@@ -18,25 +18,35 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.*;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.hadoop.hive.serde.Constants;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TList;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypeList extends DynamicSerDeTypeBase {
 
-  public boolean isPrimitive() { return false; }
-  public boolean isList() { return true; }
+  @Override
+  public boolean isPrimitive() {
+    return false;
+  }
+
+  @Override
+  public boolean isList() {
+    return true;
+  }
 
   // production is: list<FieldType()>
 
   static final private int FD_TYPE = 0;
 
+  @Override
   public Class getRealType() {
     return java.util.ArrayList.class;
   }
@@ -44,20 +54,23 @@
   public DynamicSerDeTypeList(int i) {
     super(i);
   }
+
   public DynamicSerDeTypeList(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   public DynamicSerDeTypeBase getElementType() {
-    return (DynamicSerDeTypeBase)((DynamicSerDeFieldType)this.jjtGetChild(FD_TYPE)).getMyType();
+    return ((DynamicSerDeFieldType) jjtGetChild(FD_TYPE)).getMyType();
   }
 
+  @Override
   public String toString() {
-    return Constants.LIST_TYPE_NAME + "<" + this.getElementType().toString()  + ">";
+    return Constants.LIST_TYPE_NAME + "<" + getElementType().toString() + ">";
   }
 
   @Override
-  public ArrayList<Object> deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  public ArrayList<Object> deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     TList thelist = iprot.readListBegin();
     if (thelist == null) {
       return null;
@@ -65,66 +78,70 @@
 
     ArrayList<Object> deserializeReuse;
     if (reuse != null) {
-      deserializeReuse = (ArrayList<Object>)reuse;
+      deserializeReuse = (ArrayList<Object>) reuse;
       // Trim to the size needed
       while (deserializeReuse.size() > thelist.size) {
-        deserializeReuse.remove(deserializeReuse.size()-1);
+        deserializeReuse.remove(deserializeReuse.size() - 1);
       }
     } else {
       deserializeReuse = new ArrayList<Object>();
     }
     deserializeReuse.ensureCapacity(thelist.size);
-    for(int i = 0; i < thelist.size; i++) {
-      if (i+1 > deserializeReuse.size()) {
-        deserializeReuse.add(this.getElementType().deserialize(null, iprot));
+    for (int i = 0; i < thelist.size; i++) {
+      if (i + 1 > deserializeReuse.size()) {
+        deserializeReuse.add(getElementType().deserialize(null, iprot));
       } else {
-        deserializeReuse.set(i, 
-            this.getElementType().deserialize(deserializeReuse.get(i), iprot));
+        deserializeReuse.set(i, getElementType().deserialize(
+            deserializeReuse.get(i), iprot));
       }
     }
-    // in theory, the below call isn't needed in non thrift_mode, but let's not get too crazy
+    // in theory, the below call isn't needed in non thrift_mode, but let's not
+    // get too crazy
     iprot.readListEnd();
     return deserializeReuse;
   }
 
   @Override
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
-    ListObjectInspector loi = (ListObjectInspector)oi;
-    ObjectInspector elementObjectInspector = loi.getListElementObjectInspector();
-    DynamicSerDeTypeBase mt = this.getElementType();
-
-    org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol nullProtocol = 
-      (oprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)
-      ? (org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)oprot
-      : null;
-    
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
+    ListObjectInspector loi = (ListObjectInspector) oi;
+    ObjectInspector elementObjectInspector = loi
+        .getListElementObjectInspector();
+    DynamicSerDeTypeBase mt = getElementType();
+
+    org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol nullProtocol = (oprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) ? (org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) oprot
+        : null;
+
     if (o instanceof List) {
-      List<?> list = (List<?>)o;
+      List<?> list = (List<?>) o;
       oprot.writeListBegin(new TList(mt.getType(), list.size()));
-      for (Object element: list) {
+      for (Object element : list) {
         if (element == null) {
-          assert(nullProtocol != null);
+          assert (nullProtocol != null);
           nullProtocol.writeNull();
         } else {
           mt.serialize(element, elementObjectInspector, oprot);
         }
       }
     } else {
-      Object[] list = (Object[])o;
-      oprot.writeListBegin(new TList(mt.getType(),list.length));
-      for (Object element: list) {
+      Object[] list = (Object[]) o;
+      oprot.writeListBegin(new TList(mt.getType(), list.length));
+      for (Object element : list) {
         if (element == null && nullProtocol != null) {
-          assert(nullProtocol != null);
+          assert (nullProtocol != null);
           nullProtocol.writeNull();
         } else {
           mt.serialize(element, elementObjectInspector, oprot);
         }
       }
     }
-    // in theory, the below call isn't needed in non thrift_mode, but let's not get too crazy
+    // in theory, the below call isn't needed in non thrift_mode, but let's not
+    // get too crazy
     oprot.writeListEnd();
   }
 
+  @Override
   public byte getType() {
     return TType.LIST;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeMap.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeMap.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeMap.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeMap.java Thu Jan 21 09:45:20 2010
@@ -18,24 +18,29 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-
-import java.lang.reflect.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TMap;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypeMap extends DynamicSerDeTypeBase {
 
-  public boolean isPrimitive() { return false; }
-  public boolean isMap() { return true;}
+  @Override
+  public boolean isPrimitive() {
+    return false;
+  }
+
+  @Override
+  public boolean isMap() {
+    return true;
+  }
 
   // production is: Map<FieldType(),FieldType()>
 
@@ -43,13 +48,14 @@
   private final byte FD_VALUETYPE = 1;
 
   // returns Map<?,?>
+  @Override
   public Class getRealType() {
     try {
-      Class c = this.getKeyType().getRealType();
-      Class c2 = this.getValueType().getRealType();
+      Class c = getKeyType().getRealType();
+      Class c2 = getValueType().getRealType();
       Object o = c.newInstance();
       Object o2 = c2.newInstance();
-      Map<?,?> l = Collections.singletonMap(o,o2);
+      Map<?, ?> l = Collections.singletonMap(o, o2);
       return l.getClass();
     } catch (Exception e) {
       e.printStackTrace();
@@ -62,25 +68,29 @@
   }
 
   public DynamicSerDeTypeMap(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   public DynamicSerDeTypeBase getKeyType() {
-    return (DynamicSerDeTypeBase)((DynamicSerDeFieldType)this.jjtGetChild(FD_KEYTYPE)).getMyType();
+    return ((DynamicSerDeFieldType) jjtGetChild(FD_KEYTYPE)).getMyType();
   }
 
   public DynamicSerDeTypeBase getValueType() {
-    return (DynamicSerDeTypeBase)((DynamicSerDeFieldType)this.jjtGetChild(FD_VALUETYPE)).getMyType();
+    return ((DynamicSerDeFieldType) jjtGetChild(FD_VALUETYPE)).getMyType();
   }
 
+  @Override
   public String toString() {
-    return "map<" + this.getKeyType().toString() + "," + this.getValueType().toString() + ">";
+    return "map<" + getKeyType().toString() + "," + getValueType().toString()
+        + ">";
   }
 
-  public Map<Object,Object> deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  @Override
+  public Map<Object, Object> deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     HashMap<Object, Object> deserializeReuse;
     if (reuse != null) {
-      deserializeReuse = (HashMap<Object, Object>)reuse;
+      deserializeReuse = (HashMap<Object, Object>) reuse;
       deserializeReuse.clear();
     } else {
       deserializeReuse = new HashMap<Object, Object>();
@@ -91,57 +101,58 @@
     }
     // themap might be reused by the Protocol.
     int mapSize = themap.size;
-    for(int i = 0; i < mapSize; i++) {
-      Object key = this.getKeyType().deserialize(null, iprot);
-      Object value = this.getValueType().deserialize(null, iprot);
-      deserializeReuse.put(key,value);
+    for (int i = 0; i < mapSize; i++) {
+      Object key = getKeyType().deserialize(null, iprot);
+      Object value = getValueType().deserialize(null, iprot);
+      deserializeReuse.put(key, value);
     }
 
-    // in theory, the below call isn't needed in non thrift_mode, but let's not get too crazy
+    // in theory, the below call isn't needed in non thrift_mode, but let's not
+    // get too crazy
     iprot.readMapEnd();
     return deserializeReuse;
   }
 
   TMap serializeMap = null;
+
   @Override
   public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
-  throws TException, SerDeException, NoSuchFieldException,
-  IllegalAccessException {
-    DynamicSerDeTypeBase keyType = this.getKeyType();
-    DynamicSerDeTypeBase valueType = this.getValueType();
-
-    org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol nullProtocol = 
-      (oprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)
-      ? (org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)oprot
-      : null;
-    
-    assert(oi.getCategory() == ObjectInspector.Category.MAP);
-    MapObjectInspector moi = (MapObjectInspector)oi;
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
+    DynamicSerDeTypeBase keyType = getKeyType();
+    DynamicSerDeTypeBase valueType = getValueType();
+
+    org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol nullProtocol = (oprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) ? (org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) oprot
+        : null;
+
+    assert (oi.getCategory() == ObjectInspector.Category.MAP);
+    MapObjectInspector moi = (MapObjectInspector) oi;
     ObjectInspector koi = moi.getMapKeyObjectInspector();
     ObjectInspector voi = moi.getMapValueObjectInspector();
 
-    Map<?,?> map = moi.getMap(o);
+    Map<?, ?> map = moi.getMap(o);
     serializeMap = new TMap(keyType.getType(), valueType.getType(), map.size());
     oprot.writeMapBegin(serializeMap);
-    
-    for(Iterator i = map.entrySet().iterator(); i.hasNext(); ) {
-      Map.Entry it = (Map.Entry)i.next();
+
+    for (Object element : map.entrySet()) {
+      Map.Entry it = (Map.Entry) element;
       Object key = it.getKey();
       Object value = it.getValue();
       keyType.serialize(key, koi, oprot);
       if (value == null) {
-        assert(nullProtocol != null);
+        assert (nullProtocol != null);
         nullProtocol.writeNull();
       } else {
         valueType.serialize(value, voi, oprot);
       }
     }
-    // in theory, the below call isn't needed in non thrift_mode, but let's not get too crazy
-    oprot.writeMapEnd();      
+    // in theory, the below call isn't needed in non thrift_mode, but let's not
+    // get too crazy
+    oprot.writeMapEnd();
   }
 
+  @Override
   public byte getType() {
     return TType.MAP;
   }
 };
-

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeSet.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeSet.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeSet.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeSet.java Thu Jan 21 09:45:20 2010
@@ -18,18 +18,16 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-
-import java.lang.reflect.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.protocol.TSet;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypeSet extends DynamicSerDeTypeBase {
@@ -41,14 +39,16 @@
   public DynamicSerDeTypeSet(int i) {
     super(i);
   }
+
   public DynamicSerDeTypeSet(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   // returns Set<?>
+  @Override
   public Class getRealType() {
     try {
-      Class c = this.getElementType().getRealType();
+      Class c = getElementType().getRealType();
       Object o = c.newInstance();
       Set<?> l = Collections.singleton(o);
       return l.getClass();
@@ -59,62 +59,68 @@
   }
 
   public DynamicSerDeTypeBase getElementType() {
-    return (DynamicSerDeTypeBase)((DynamicSerDeFieldType)this.jjtGetChild(FD_TYPE)).getMyType();
+    return ((DynamicSerDeFieldType) jjtGetChild(FD_TYPE)).getMyType();
   }
 
+  @Override
   public String toString() {
-    return "set<" + this.getElementType().toString()  + ">";
+    return "set<" + getElementType().toString() + ">";
   }
 
+  @Override
   public byte getType() {
     return TType.SET;
   }
 
-  /** NOTE: Set is not supported by Hive yet.
+  /**
+   * NOTE: Set is not supported by Hive yet.
    */
   @Override
   public Object deserialize(Object reuse, TProtocol iprot)
-  throws SerDeException, TException, IllegalAccessException {
+      throws SerDeException, TException, IllegalAccessException {
     TSet theset = iprot.readSetBegin();
     if (theset == null) {
       return null;
     }
     Set<Object> result;
     if (reuse != null) {
-      result = (Set<Object>)reuse;
+      result = (Set<Object>) reuse;
       result.clear();
     } else {
       result = new HashSet<Object>();
     }
-    for(int i = 0; i < theset.size; i++) {
-      Object elem = this.getElementType().deserialize(null, iprot);
+    for (int i = 0; i < theset.size; i++) {
+      Object elem = getElementType().deserialize(null, iprot);
       result.add(elem);
     }
-    // in theory, the below call isn't needed in non thrift_mode, but let's not get too crazy
+    // in theory, the below call isn't needed in non thrift_mode, but let's not
+    // get too crazy
     iprot.readSetEnd();
     return result;
   }
 
-  /** NOTE: Set is not supported by Hive yet.
-   *  The code uses ListObjectInspector right now. We need to change it to 
-   *  SetObjectInspector when that is done.
+  /**
+   * NOTE: Set is not supported by Hive yet. The code uses ListObjectInspector
+   * right now. We need to change it to SetObjectInspector when that is done.
    */
   TSet tset = null;
+
   @Override
   public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
-  throws TException, SerDeException, NoSuchFieldException,
-  IllegalAccessException {
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
 
-    ListObjectInspector loi = (ListObjectInspector)oi;
+    ListObjectInspector loi = (ListObjectInspector) oi;
 
-    Set<Object> set = (Set<Object>)o;
-    DynamicSerDeTypeBase mt = this.getElementType();
+    Set<Object> set = (Set<Object>) o;
+    DynamicSerDeTypeBase mt = getElementType();
     tset = new TSet(mt.getType(), set.size());
     oprot.writeSetBegin(tset);
-    for(Object element: set) {
+    for (Object element : set) {
       mt.serialize(element, loi.getListElementObjectInspector(), oprot);
     }
-    // in theory, the below call isn't needed in non thrift_mode, but let's not get too crazy
+    // in theory, the below call isn't needed in non thrift_mode, but let's not
+    // get too crazy
     oprot.writeSetEnd();
   }
 }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeString.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeString.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeString.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypeString.java Thu Jan 21 09:45:20 2010
@@ -18,22 +18,13 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.StringObjectInspector;
 import org.apache.hadoop.hive.serde2.thrift.WriteTextProtocol;
-import org.apache.hadoop.io.Text;
-
-import java.lang.reflect.*;
-import org.apache.thrift.protocol.TType.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypeString extends DynamicSerDeTypeBase {
 
@@ -42,32 +33,45 @@
   public DynamicSerDeTypeString(int i) {
     super(i);
   }
+
   public DynamicSerDeTypeString(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
-  public Class getRealType() { return java.lang.String.class; }
 
-  public String toString() { return "string"; }
+  @Override
+  public Class getRealType() {
+    return java.lang.String.class;
+  }
 
-  public String deserialize(TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  @Override
+  public String toString() {
+    return "string";
+  }
+
+  public String deserialize(TProtocol iprot) throws SerDeException, TException,
+      IllegalAccessException {
     return iprot.readString();
   }
 
   @Override
-  public Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     return iprot.readString();
   }
-  
+
   @Override
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
     StringObjectInspector poi = (StringObjectInspector) oi;
     if (oprot instanceof WriteTextProtocol) {
-      ((WriteTextProtocol)oprot).writeText((Text)poi.getPrimitiveWritableObject(o));
+      ((WriteTextProtocol) oprot).writeText(poi.getPrimitiveWritableObject(o));
     } else {
-      oprot.writeString((String)poi.getPrimitiveJavaObject(o));
+      oprot.writeString(poi.getPrimitiveJavaObject(o));
     }
   }
 
+  @Override
   public byte getType() {
     return TType.STRING;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypedef.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypedef.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypedef.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypedef.java Thu Jan 21 09:45:20 2010
@@ -18,18 +18,10 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-
-import java.lang.reflect.*;
-import org.apache.thrift.protocol.TType.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
 
 public class DynamicSerDeTypedef extends DynamicSerDeTypeBase {
 
@@ -40,41 +32,44 @@
   public DynamicSerDeTypedef(int i) {
     super(i);
   }
+
   public DynamicSerDeTypedef(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
   private DynamicSerDeSimpleNode getDefinitionType() {
-    return (DynamicSerDeSimpleNode)this.jjtGetChild(FD_DEFINITION_TYPE);
+    return (DynamicSerDeSimpleNode) jjtGetChild(FD_DEFINITION_TYPE);
   }
 
-
   public DynamicSerDeTypeBase getMyType() {
-    DynamicSerDeSimpleNode child = this.getDefinitionType();
-    DynamicSerDeTypeBase ret = (DynamicSerDeTypeBase)child.jjtGetChild(0);
+    DynamicSerDeSimpleNode child = getDefinitionType();
+    DynamicSerDeTypeBase ret = (DynamicSerDeTypeBase) child.jjtGetChild(0);
     return ret;
   }
 
+  @Override
   public String toString() {
-    String result = "typedef " + this.name + "(";
-    result += this.getDefinitionType().toString();
+    String result = "typedef " + name + "(";
+    result += getDefinitionType().toString();
     result += ")";
     return result;
   }
 
+  @Override
   public byte getType() {
     throw new RuntimeException("not implemented");
   }
 
   @Override
   public Object deserialize(Object reuse, TProtocol iprot)
-  throws SerDeException, TException, IllegalAccessException {
+      throws SerDeException, TException, IllegalAccessException {
     throw new RuntimeException("not implemented");
   }
+
   @Override
   public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
-  throws TException, SerDeException, NoSuchFieldException,
-  IllegalAccessException {
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
     throw new RuntimeException("not implemented");
   }
 

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei16.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei16.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei16.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei16.java Thu Jan 21 09:45:20 2010
@@ -18,53 +18,57 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ShortObjectInspector;
-
-import java.lang.reflect.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypei16 extends DynamicSerDeTypeBase {
 
-  public Class getRealType() { return Integer.valueOf(2).getClass(); }
+  @Override
+  public Class getRealType() {
+    return Integer.valueOf(2).getClass();
+  }
 
   // production is: i16
 
   public DynamicSerDeTypei16(int i) {
     super(i);
   }
+
   public DynamicSerDeTypei16(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
-  public String toString() { return "i16"; }
+  @Override
+  public String toString() {
+    return "i16";
+  }
 
   @Override
-  public Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     int val = iprot.readI16();
-    if (val == 0 && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol && 
-        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)iprot).lastPrimitiveWasNull()) {
+    if (val == 0
+        && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol
+        && ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) iprot)
+            .lastPrimitiveWasNull()) {
       return null;
     }
     return Integer.valueOf(val);
   }
 
   @Override
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
     ShortObjectInspector poi = (ShortObjectInspector) oi;
     oprot.writeI16(poi.get(o));
   }
 
+  @Override
   public byte getType() {
     return TType.I16;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei32.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei32.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei32.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei32.java Thu Jan 21 09:45:20 2010
@@ -18,20 +18,11 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.ShortObjectInspector;
-
-import java.lang.reflect.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypei32 extends DynamicSerDeTypeBase {
@@ -41,32 +32,47 @@
   public DynamicSerDeTypei32(int i) {
     super(i);
   }
+
   public DynamicSerDeTypei32(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
-  public String toString() { return "i32"; }
+  @Override
+  public String toString() {
+    return "i32";
+  }
 
   @Override
-  public Object deserialize(Object reuse, TProtocol iprot) throws SerDeException, TException, IllegalAccessException {
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     int val = iprot.readI32();
-    if (val == 0 && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol && 
-        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)iprot).lastPrimitiveWasNull()) {
+    if (val == 0
+        && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol
+        && ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) iprot)
+            .lastPrimitiveWasNull()) {
       return null;
     }
     return Integer.valueOf(val);
   }
 
   @Override
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
     IntObjectInspector poi = (IntObjectInspector) oi;
     oprot.writeI32(poi.get(o));
   }
 
-  public Class getRealType() { return java.lang.Integer.class; }
-  public Integer getRealTypeInstance() { return Integer.valueOf(0); }
+  @Override
+  public Class getRealType() {
+    return java.lang.Integer.class;
+  }
 
+  public Integer getRealTypeInstance() {
+    return Integer.valueOf(0);
+  }
 
+  @Override
   public byte getType() {
     return TType.I32;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei64.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei64.java?rev=901621&r1=901620&r2=901621&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei64.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypei64.java Thu Jan 21 09:45:20 2010
@@ -18,53 +18,57 @@
 
 package org.apache.hadoop.hive.serde2.dynamic_type;
 
-import org.apache.thrift.TException;
-import org.apache.thrift.TApplicationException;
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.server.*;
-import org.apache.thrift.transport.*;
-import java.util.*;
-import java.io.*;
-import org.apache.hadoop.hive.serde2.*;
+import org.apache.hadoop.hive.serde2.SerDeException;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector;
-
-import java.lang.reflect.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TType;
 
 public class DynamicSerDeTypei64 extends DynamicSerDeTypeBase {
 
-  public Class getRealType() { return Long.valueOf(0).getClass(); }
+  @Override
+  public Class getRealType() {
+    return Long.valueOf(0).getClass();
+  }
 
   // production is: i64
 
   public DynamicSerDeTypei64(int i) {
     super(i);
   }
+
   public DynamicSerDeTypei64(thrift_grammar p, int i) {
-    super(p,i);
+    super(p, i);
   }
 
-  public String toString() { return "i64"; }
+  @Override
+  public String toString() {
+    return "i64";
+  }
 
   @Override
-  public Object deserialize(Object reuse, TProtocol iprot)  throws SerDeException, TException, IllegalAccessException {
+  public Object deserialize(Object reuse, TProtocol iprot)
+      throws SerDeException, TException, IllegalAccessException {
     long val = iprot.readI64();
-    if (val == 0 && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol && 
-        ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol)iprot).lastPrimitiveWasNull()) {
+    if (val == 0
+        && iprot instanceof org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol
+        && ((org.apache.hadoop.hive.serde2.thrift.WriteNullsProtocol) iprot)
+            .lastPrimitiveWasNull()) {
       return null;
     }
     return Long.valueOf(val);
   }
 
   @Override
-  public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException,IllegalAccessException  {
+  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
+      throws TException, SerDeException, NoSuchFieldException,
+      IllegalAccessException {
     LongObjectInspector poi = (LongObjectInspector) oi;
     oprot.writeI64(poi.get(o));
   }
 
+  @Override
   public byte getType() {
     return TType.I64;
   }