You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2013/08/27 19:10:01 UTC

svn commit: r1517888 [6/6] - in /hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions: ./ aggregates/ aggregates/gen/ gen/ templates/

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareScalar.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareScalar.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareScalar.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareScalar.txt Tue Aug 27 17:09:56 2013
@@ -27,6 +27,9 @@ import org.apache.hadoop.hive.ql.exec.ve
  * This is a generated class to evaluate a <OperatorSymbol> comparison on a vector of strings.
  */
 public class <ClassName> extends VectorExpression {
+
+  private static final long serialVersionUID = 1L;
+
   private int colNum;
   private byte[] value;
 
@@ -35,6 +38,9 @@ public class <ClassName> extends VectorE
     this.value = value;
   }
 
+  public <ClassName>() {
+  }
+
   @Override
   public void evaluate(VectorizedRowBatch batch) {
     if (childExpressions != null) {
@@ -136,4 +142,20 @@ public class <ClassName> extends VectorE
   public String getOutputType() {
     return "boolean";
   }
+  
+  public int getColNum() {
+    return colNum;
+  }
+
+  public void setColNum(int colNum) {
+    this.colNum = colNum;
+  }
+
+  public byte[] getValue() {
+    return value;
+  }
+
+  public void setValue(byte[] value) {
+    this.value = value;
+  }
 }

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringScalarCompareColumn.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringScalarCompareColumn.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringScalarCompareColumn.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringScalarCompareColumn.txt Tue Aug 27 17:09:56 2013
@@ -28,6 +28,9 @@ import org.apache.hadoop.hive.ql.exec.ve
  * Do not edit the generated code directly. 
  */
 public class <ClassName> extends VectorExpression {
+
+  private static final long serialVersionUID = 1L;
+
   private int colNum;
   private byte[] value;
 
@@ -36,6 +39,9 @@ public class <ClassName> extends VectorE
     this.value = value;
   }
 
+  public <ClassName>() {
+  }
+
   @Override
   public void evaluate(VectorizedRowBatch batch) {
     if (childExpressions != null) {
@@ -137,4 +143,20 @@ public class <ClassName> extends VectorE
   public String getOutputType() {
     return "boolean";
   }
+  
+  public int getColNum() {
+    return colNum;
+  }
+
+  public void setColNum(int colNum) {
+    this.colNum = colNum;
+  }
+
+  public byte[] getValue() {
+    return value;
+  }
+
+  public void setValue(byte[] value) {
+    this.value = value;
+  }
 }

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt Tue Aug 27 17:09:56 2013
@@ -36,6 +36,9 @@ import org.apache.hadoop.hive.ql.exec.ve
  * column vector on the right. The result is output to an output column vector.
  */
 public class <ClassName> extends VectorExpression {
+
+  private static final long serialVersionUID = 1L;
+
   private int colNum;
   private <OperandType1> value;
   private int outputColumn;
@@ -46,6 +49,9 @@ public class <ClassName> extends VectorE
     this.outputColumn = outputColumn;
   }
 
+  public <ClassName>() {
+  }
+
   @Override
   /**
    * Method to evaluate scalar-column operation in vectorized fashion.
@@ -117,4 +123,25 @@ public class <ClassName> extends VectorE
   public String getOutputType() {
     return "<ReturnType>";
   }
+  
+  public int getColNum() {
+    return colNum;
+  }
+
+  public void setColNum(int colNum) {
+    this.colNum = colNum;
+  }
+
+  public <OperandType1> getValue() {
+    return value;
+  }
+
+  public void setValue(<OperandType1> value) {
+    this.value = value;
+  }
+
+  public void setOutputColumn(int outputColumn) {
+    this.outputColumn = outputColumn;
+  }
+  
 }

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt Tue Aug 27 17:09:56 2013
@@ -44,12 +44,17 @@ import org.apache.hadoop.hive.serde2.obj
 @Description(name = "avg",
     value = "_FUNC_(expr) - Returns the average value of expr (vectorized, type: <ValueType>)")
 public class <ClassName> extends VectorAggregateExpression {
+
+    private static final long serialVersionUID = 1L;
     
     /** class for storing the current aggregate value. */
     static class Aggregation implements AggregationBuffer {
-      private double sum;
-      private long count;
-      private boolean isNull;
+
+      private static final long serialVersionUID = 1L;
+
+      transient private double sum;
+      transient private long count;
+      transient private boolean isNull;
       
       public void sumValue(<ValueType> value) {
         if (isNull) {
@@ -69,20 +74,23 @@ public class <ClassName> extends VectorA
     }
     
     private VectorExpression inputExpression;
-    private Object[] partialResult;
-    private LongWritable resultCount;
-    private DoubleWritable resultSum;
-    private StructObjectInspector soi;
+    transient private Object[] partialResult;
+    transient private LongWritable resultCount;
+    transient private DoubleWritable resultSum;
+    transient private StructObjectInspector soi;
         
     public <ClassName>(VectorExpression inputExpression) {
-      super();
+      this();
       this.inputExpression = inputExpression;
+    }
+
+    public <ClassName>() {
+      super();
       partialResult = new Object[2];
       resultCount = new LongWritable();
       resultSum = new DoubleWritable();
       partialResult[0] = resultCount;
       partialResult[1] = resultSum;
-      
       initPartialResultInspector();
     }
 
@@ -454,5 +462,13 @@ public class <ClassName> extends VectorA
   public void init(AggregationDesc desc) throws HiveException {
     // No-op
   }
+  
+  public VectorExpression getInputExpression() {
+    return inputExpression;
+  }
+
+  public void setInputExpression(VectorExpression inputExpression) {
+    this.inputExpression = inputExpression;
+  }
 }
 

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt Tue Aug 27 17:09:56 2013
@@ -38,13 +38,18 @@ import org.apache.hadoop.hive.serde2.obj
 @Description(name = "<DescriptionName>", 
     value = "<DescriptionValue>")
 public class <ClassName> extends VectorAggregateExpression {
+   
+    private static final long serialVersionUID = 1L;
     
     /** 
      * class for storing the current aggregate value.
      */
     static private final class Aggregation implements AggregationBuffer {
-      private <ValueType> value;
-      private boolean isNull;
+
+      private static final long serialVersionUID = 1L;
+
+      transient private <ValueType> value;
+      transient private boolean isNull;
 
       public void checkValue(<ValueType> value) {
         if (isNull) {
@@ -62,12 +67,16 @@ public class <ClassName> extends VectorA
     }
     
     private VectorExpression inputExpression;
-    private VectorExpressionWriter resultWriter;
+    private transient VectorExpressionWriter resultWriter;
     
     public <ClassName>(VectorExpression inputExpression) {
-      super();
+      this();
       this.inputExpression = inputExpression;
     }
+
+    public <ClassName>() {
+      super();
+    }
     
     @Override
     public void init(AggregationDesc desc) throws HiveException {
@@ -421,5 +430,12 @@ public class <ClassName> extends VectorA
       model.memoryAlign());
   }
 
+  public VectorExpression getInputExpression() {
+    return inputExpression;
+  }
+
+  public void setInputExpression(VectorExpression inputExpression) {
+    this.inputExpression = inputExpression;
+  }
 }
 

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt Tue Aug 27 17:09:56 2013
@@ -41,15 +41,19 @@ import org.apache.hadoop.io.Text;
     value = "<DescriptionValue>")
 public class <ClassName> extends VectorAggregateExpression {
 
+    private static final long serialVersionUID = 1L;
+
     /** 
      * class for storing the current aggregate value.
      */
     static private final class Aggregation implements AggregationBuffer {
 
-      private final static int MIN_BUFFER_SIZE = 16;
-      private byte[] bytes = new byte[MIN_BUFFER_SIZE];
-      private int length;
-      private boolean isNull;
+      private static final long serialVersionUID = 1L;
+
+      transient private final static int MIN_BUFFER_SIZE = 16;
+      transient private byte[] bytes = new byte[MIN_BUFFER_SIZE];
+      transient private int length;
+      transient private boolean isNull;
 
       public void checkValue(byte[] bytes, int start, int length) {
         if (isNull) {
@@ -75,15 +79,18 @@ public class <ClassName> extends VectorA
         JavaDataModel model = JavaDataModel.get();
         return model.lengthForByteArrayOfSize(bytes.length);
       }
-
     }
     
     private VectorExpression inputExpression;
-    private Text result;
+    transient private Text result;
     
     public <ClassName>(VectorExpression inputExpression) {
-      super();
+      this();
       this.inputExpression = inputExpression;
+    }
+
+    public <ClassName>() {
+      super();
       result = new Text();
     }
     
@@ -381,5 +388,13 @@ public class <ClassName> extends VectorA
     public void init(AggregationDesc desc) throws HiveException {
       // No-op
     }
+
+    public VectorExpression getInputExpression() {
+      return inputExpression;
+    }
+
+    public void setInputExpression(VectorExpression inputExpression) {
+      this.inputExpression = inputExpression;
+    }
 }
 

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt Tue Aug 27 17:09:56 2013
@@ -39,13 +39,18 @@ import org.apache.hadoop.hive.serde2.obj
 @Description(name = "sum", 
     value = "_FUNC_(expr) - Returns the sum value of expr (vectorized, type: <ValueType>)")
 public class <ClassName> extends VectorAggregateExpression {
+   
+    private static final long serialVersionUID = 1L;
     
     /** 
      * class for storing the current aggregate value.
      */
     private static final class Aggregation implements AggregationBuffer {
-      private <ValueType> sum;
-      private boolean isNull;
+
+      private static final long serialVersionUID = 1L;
+
+      transient private <ValueType> sum;
+      transient private boolean isNull;
       
       public void sumValue(<ValueType> value) {
         if (isNull) {
@@ -62,12 +67,16 @@ public class <ClassName> extends VectorA
       }
     }
     
-    private final VectorExpression inputExpression;
-    private final <OutputType> result;
+    private VectorExpression inputExpression;
+    transient private final <OutputType> result;
     
     public <ClassName>(VectorExpression inputExpression) {
-      super();
+      this();
       this.inputExpression = inputExpression;
+    }
+
+    public <ClassName>() {
+      super();
       result = new <OutputType>();
     }
 
@@ -416,6 +425,12 @@ public class <ClassName> extends VectorA
     // No-op
   }
 
+  public VectorExpression getInputExpression() {
+    return inputExpression;
+  }
 
+  public void setInputExpression(VectorExpression inputExpression) {
+    this.inputExpression = inputExpression;
+  }
 }
 

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt?rev=1517888&r1=1517887&r2=1517888&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt (original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt Tue Aug 27 17:09:56 2013
@@ -43,15 +43,20 @@ import org.apache.hadoop.hive.serde2.obj
 @Description(name = "<DescriptionName>",
     value = "<DescriptionValue>")
 public class <ClassName> extends VectorAggregateExpression {
+
+    private static final long serialVersionUID = 1L;
     
     /** 
     /* class for storing the current aggregate value. 
     */
     private static final class Aggregation implements AggregationBuffer {
-      private double sum;
-      private long count;
-      private double variance;
-      private boolean isNull;
+
+      private static final long serialVersionUID = 1L;
+
+      transient private double sum;
+      transient private long count;
+      transient private double variance;
+      transient private boolean isNull;
       
       public void init() {
         isNull = false;
@@ -67,17 +72,21 @@ public class <ClassName> extends VectorA
     }
     
     private VectorExpression inputExpression;
-    private LongWritable resultCount;
-    private DoubleWritable resultSum;
-    private DoubleWritable resultVariance;
-    private Object[] partialResult;
+    transient private LongWritable resultCount;
+    transient private DoubleWritable resultSum;
+    transient private DoubleWritable resultVariance;
+    transient private Object[] partialResult;
     
-    private ObjectInspector soi;
+    transient private ObjectInspector soi;
     
     
     public <ClassName>(VectorExpression inputExpression) {
-      super();
+      this();
       this.inputExpression = inputExpression;
+    }
+
+    public <ClassName>() {
+      super();
       partialResult = new Object[3];
       resultCount = new LongWritable();
       resultSum = new DoubleWritable();
@@ -500,6 +509,12 @@ public class <ClassName> extends VectorA
     // No-op
   }
 
+  public VectorExpression getInputExpression() {
+    return inputExpression;
+  }
 
+  public void setInputExpression(VectorExpression inputExpression) {
+    this.inputExpression = inputExpression;
+  } 
 }