diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java index 29300fb..d29c1bb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java @@ -110,7 +110,7 @@ private transient int avgVariableSize; /** - * Current number of entries in the hash table + * Current number of entries in the hash table. */ private transient int numEntriesHashTable; @@ -130,7 +130,7 @@ private static final int FLUSH_CHECK_THRESHOLD = 10000; /** - * Percent of entries to flush when memory threshold exceeded + * Percent of entries to flush when memory threshold exceeded. */ private static final float PERCENT_ENTRIES_TO_FLUSH = 0.1f; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java index 5c92005..9955d09 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java @@ -34,13 +34,12 @@ public class VectorHashKeyWrapperBatch { /** - * Helper class for looking up a key value based on key index - * + * Helper class for looking up a key value based on key index. */ private static class KeyLookupHelper { - public int longIndex; - public int doubleIndex; - public int stringIndex; + private int longIndex; + private int doubleIndex; + private int stringIndex; } /** @@ -49,22 +48,22 @@ private VectorExpression[] keyExpressions; /** - * indices of LONG primitive keys + * indices of LONG primitive keys. */ private int[] longIndices; /** - * indices of DOUBLE primitive keys + * indices of DOUBLE primitive keys. */ private int[] doubleIndices; - /* - * indices of string (byte[]) primitive keys + /** + * indices of string (byte[]) primitive keys. */ private int[] stringIndices; /** - * pre-allocated batch size vector of keys wrappers. + * Pre-allocated batch size vector of keys wrappers. * N.B. these keys are **mutable** and should never be used in a HashMap. * Always clone the key wrapper to obtain an immutable keywrapper suitable * to use a key in a HashMap. @@ -72,7 +71,7 @@ private VectorHashKeyWrapper[] vectorHashKeyWrappers; /** - * lookup vector to map from key index to primitive type index + * Lookup vector to map from key index to primitive type index. */ private KeyLookupHelper[] indexLookup; @@ -90,7 +89,7 @@ public int getKeysFixedSize() { } /** - * Accessor for the batch-sized array of key wrappers + * Accessor for the batch-sized array of key wrappers. */ public VectorHashKeyWrapper[] getVectorHashKeyWrappers() { return vectorHashKeyWrappers; @@ -106,7 +105,7 @@ public int getKeysFixedSize() { * @param batch * @throws HiveException */ - public void evaluateBatch (VectorizedRowBatch batch) throws HiveException { + public void evaluateBatch(VectorizedRowBatch batch) throws HiveException { for(int i = 0; i < keyExpressions.length; ++i) { keyExpressions[i].evaluate(batch); } @@ -127,7 +126,8 @@ public void evaluateBatch (VectorizedRowBatch batch) throws HiveException { } else if (!columnVector.noNulls && !columnVector.isRepeating && batch.selectedInUse) { assignLongNullsNoRepeatingSelection (i, batch.size, columnVector, batch.selected); } else { - throw new HiveException (String.format("Unimplemented Long null/repeat/selected combination %b/%b/%b", + throw new HiveException (String.format( + "Unimplemented Long null/repeat/selected combination %b/%b/%b", columnVector.noNulls, columnVector.isRepeating, batch.selectedInUse)); } } @@ -148,7 +148,8 @@ public void evaluateBatch (VectorizedRowBatch batch) throws HiveException { } else if (!columnVector.noNulls && !columnVector.isRepeating && batch.selectedInUse) { assignDoubleNullsNoRepeatingSelection (i, batch.size, columnVector, batch.selected); } else { - throw new HiveException (String.format("Unimplemented Double null/repeat/selected combination %b/%b/%b", + throw new HiveException (String.format( + "Unimplemented Double null/repeat/selected combination %b/%b/%b", columnVector.noNulls, columnVector.isRepeating, batch.selectedInUse)); } } @@ -169,7 +170,8 @@ public void evaluateBatch (VectorizedRowBatch batch) throws HiveException { } else if (!columnVector.noNulls && !columnVector.isRepeating && batch.selectedInUse) { assignStringNullsNoRepeatingSelection (i, batch.size, columnVector, batch.selected); } else { - throw new HiveException (String.format("Unimplemented String null/repeat/selected combination %b/%b/%b", + throw new HiveException (String.format( + "Unimplemented String null/repeat/selected combination %b/%b/%b", columnVector.noNulls, columnVector.isRepeating, batch.selectedInUse)); } } @@ -505,7 +507,8 @@ public static VectorHashKeyWrapperBatch compileKeyWrapperBatch(VectorExpression[ compiledKeyWrapperBatch.keysFixedSize += model.lengthForDoubleArrayOfSize(doubleIndicesIndex); compiledKeyWrapperBatch.keysFixedSize += model.lengthForObjectArrayOfSize(stringIndicesIndex); compiledKeyWrapperBatch.keysFixedSize += model.lengthForIntArrayOfSize(longIndicesIndex) * 2; - compiledKeyWrapperBatch.keysFixedSize += model.lengthForBooleanArrayOfSize(keyExpressions.length); + compiledKeyWrapperBatch.keysFixedSize += + model.lengthForBooleanArrayOfSize(keyExpressions.length); return compiledKeyWrapperBatch; } @@ -520,16 +523,16 @@ public Object getWritableKeyValue(VectorHashKeyWrapper kw, int i, KeyLookupHelper klh = indexLookup[i]; if (klh.longIndex >= 0) { - return kw.getIsLongNull(klh.longIndex) ? null : + return kw.getIsLongNull(klh.longIndex) ? null : keyOutputWriter.writeValue(kw.getLongValue(klh.longIndex)); } else if (klh.doubleIndex >= 0) { return kw.getIsDoubleNull(klh.doubleIndex) ? null : keyOutputWriter.writeValue(kw.getDoubleValue(klh.doubleIndex)); } else if (klh.stringIndex >= 0) { - return kw.getIsBytesNull(klh.stringIndex) ? null : + return kw.getIsBytesNull(klh.stringIndex) ? null : keyOutputWriter.writeValue( - kw.getBytes(klh.stringIndex), - kw.getByteStart(klh.stringIndex), + kw.getBytes(klh.stringIndex), + kw.getByteStart(klh.stringIndex), kw.getByteLength(klh.stringIndex)); } else { throw new HiveException(String.format( diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedRowBatchCtx.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedRowBatchCtx.java index 8a9f4c3..a600d74 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedRowBatchCtx.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedRowBatchCtx.java @@ -26,6 +26,7 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants; import org.apache.hadoop.hive.ql.exec.Utilities; import org.apache.hadoop.hive.ql.io.HiveFileFormatUtils; import org.apache.hadoop.hive.ql.io.IOPrepareCache; @@ -46,10 +47,8 @@ /** * Context for Vectorized row batch. this calss does eager deserialization of row data using serde * in the RecordReader layer. - * It has supports partitions in this layer so that the vectorized batch is populated correctly with - * the partition column. - * VectorizedRowBatchCtx. - * + * It has supports partitions in this layer so that the vectorized batch is populated correctly + * with the partition column. */ public class VectorizedRowBatchCtx { @@ -63,7 +62,7 @@ private Deserializer deserializer; // Hash map of partition values. Key=TblColName value=PartitionValue - private LinkedHashMap partitionValues; + private Map partitionValues; // Column projection list - List of column indexes to include. This // list does not contain partition columns @@ -82,7 +81,7 @@ * Hash map of partition values. Key=TblColName value=PartitionValue */ public VectorizedRowBatchCtx(StructObjectInspector rawRowOI, StructObjectInspector rowOI, - Deserializer deserializer, LinkedHashMap partitionValues) { + Deserializer deserializer, Map partitionValues) { this.rowOI = rowOI; this.rawRowOI = rawRowOI; this.deserializer = deserializer; @@ -147,8 +146,7 @@ public void init(Configuration hiveConf, FileSplit split) throws ClassNotFoundEx deserializer = partDeserializer; // Check to see if this split is part of a partition of a table - String pcols = partProps - .getProperty(org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_PARTITION_COLUMNS); + String pcols = partProps.getProperty(hive_metastoreConstants.META_TABLE_PARTITION_COLUMNS); if (pcols != null && pcols.length() > 0) { @@ -212,7 +210,8 @@ public VectorizedRowBatch createVectorizedRowBatch() throws HiveException // partition column then create the column vector. Also note that partition columns are not // in the included list. if ((colsToInclude == null) || colsToInclude.contains(j) - || ((partitionValues != null) && (partitionValues.get(fieldRefs.get(j).getFieldName()) != null))) { + || ((partitionValues != null) && + (partitionValues.get(fieldRefs.get(j).getFieldName()) != null))) { ObjectInspector foi = fieldRefs.get(j).getFieldObjectInspector(); switch (foi.getCategory()) { case PRIMITIVE: { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSerde.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSerde.java index a5753a7..bff6200 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSerde.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSerde.java @@ -22,11 +22,14 @@ import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.io.Writable; +/** + * Serdes that support vectorized {@link VectorizedRowBatch} must implement this interface. + */ public interface VectorizedSerde { Writable serializeVector(VectorizedRowBatch vrg, ObjectInspector objInspector) throws SerDeException; void deserializeVector(Object rowBlob, int rowsInBlob, VectorizedRowBatch reuseBatch) - throws SerDeException; + throws SerDeException; } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java index 065646a..8a24d23 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java @@ -20,19 +20,21 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Evaluate AND of two boolean columns and store result in the output boolean column. + */ public class ColAndCol extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private final int colNum1; + private final int colNum2; + private final int outputColumn; - public ColAndCol(int colNum1, int colNum2, int outputColumn) - { - this.colNum1 = colNum1; - this.colNum2 = colNum2; - this.outputColumn = outputColumn; - } + public ColAndCol(int colNum1, int colNum2, int outputColumn) { + this.colNum1 = colNum1; + this.colNum2 = colNum2; + this.outputColumn = outputColumn; + } - @Override + @Override public void evaluate(VectorizedRowBatch batch) { if (childExpressions != null) { @@ -49,11 +51,11 @@ public void evaluate(VectorizedRowBatch batch) { LongColumnVector outV = (LongColumnVector) batch.cols[outputColumn]; long[] outputVector = outV.vector; if (n <= 0) { - //Nothing to do + // Nothing to do return; } - //Handle null + // Handle null if (inputColVector1.noNulls && !inputColVector2.noNulls) { outV.noNulls = false; if (inputColVector2.isRepeating) { @@ -61,12 +63,12 @@ public void evaluate(VectorizedRowBatch batch) { outV.isNull[0] = true; } else { if (batch.selectedInUse) { - for(int j = 0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; outV.isNull[i] = inputColVector2.isNull[i]; } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outV.isNull[i] = inputColVector2.isNull[i]; } } @@ -107,23 +109,23 @@ public void evaluate(VectorizedRowBatch batch) { } } - //Now disregard null in second pass. - if ( (inputColVector1.isRepeating) && (inputColVector2.isRepeating) ) { - //All must be selected otherwise size would be zero - //Repeating property will not change. + // Now disregard null in second pass. + if ((inputColVector1.isRepeating) && (inputColVector2.isRepeating)) { + // All must be selected otherwise size would be zero + // Repeating property will not change. outV.isRepeating = true; - outputVector[0] = vector1[0] & vector2[0] ; + outputVector[0] = vector1[0] & vector2[0]; } else if (batch.selectedInUse) { - for(int j=0; j != n; j++) { - int i = sel[j]; - outputVector[i] = vector1[i] & vector2[i] ; - } - } else { - for(int i = 0; i != n; i++) { - outputVector[i] = vector1[i] & vector2[i]; - } - } - } + for (int j = 0; j != n; j++) { + int i = sel[j]; + outputVector[i] = vector1[i] & vector2[i]; + } + } else { + for (int i = 0; i != n; i++) { + outputVector[i] = vector1[i] & vector2[i]; + } + } + } @Override public int getOutputColumn() { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java index 17d209a..4a045e8 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java @@ -21,19 +21,23 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * This class performs OR expression on two input columns and stores, + * the boolean output in a separate output column. The boolean values + * are supposed to be represented as 0/1 in a long vector. + */ public class ColOrCol extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private final int colNum1; + private final int colNum2; + private final int outputColumn; - public ColOrCol(int colNum1, int colNum2, int outputColumn) - { - this.colNum1 = colNum1; - this.colNum2 = colNum2; - this.outputColumn = outputColumn; - } + public ColOrCol(int colNum1, int colNum2, int outputColumn) { + this.colNum1 = colNum1; + this.colNum2 = colNum2; + this.outputColumn = outputColumn; + } - @Override + @Override public void evaluate(VectorizedRowBatch batch) { if (childExpressions != null) { @@ -50,71 +54,71 @@ public void evaluate(VectorizedRowBatch batch) { LongColumnVector outV = (LongColumnVector) batch.cols[outputColumn]; long[] outputVector = outV.vector; if (n <= 0) { - //Nothing to do + // Nothing to do return; } if (inputColVector1.noNulls && inputColVector2.noNulls) { - if ( (inputColVector1.isRepeating) && (inputColVector2.isRepeating) ) { - //All must be selected otherwise size would be zero - //Repeating property will not change. + if ((inputColVector1.isRepeating) && (inputColVector2.isRepeating)) { + // All must be selected otherwise size would be zero + // Repeating property will not change. outV.isRepeating = true; - outputVector[0] = vector1[0] | vector2[0] ; + outputVector[0] = vector1[0] | vector2[0]; } else if (inputColVector1.isRepeating && !inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[0] | vector2[i] ; + outputVector[i] = vector1[0] | vector2[i]; } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[0] | vector2[i]; } } outV.isRepeating = false; } else if (!inputColVector1.isRepeating && inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[i] | vector2[0] ; + outputVector[i] = vector1[i] | vector2[0]; } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[i] | vector2[0]; } } outV.isRepeating = false; - } else /* neither side is repeating */ { + } else /* neither side is repeating */{ if (batch.selectedInUse) { - for(int j=0; j != n; j++) { - int i = sel[j]; - outputVector[i] = vector1[i] | vector2[i] ; - } - } else { - for(int i = 0; i != n; i++) { - outputVector[i] = vector1[i] | vector2[i]; - } - } + for (int j = 0; j != n; j++) { + int i = sel[j]; + outputVector[i] = vector1[i] | vector2[i]; + } + } else { + for (int i = 0; i != n; i++) { + outputVector[i] = vector1[i] | vector2[i]; + } + } outV.isRepeating = false; } outV.noNulls = true; } else if (inputColVector1.noNulls && !inputColVector2.noNulls) { // only input 2 side has nulls - if ( (inputColVector1.isRepeating) && (inputColVector2.isRepeating) ) { - //All must be selected otherwise size would be zero - //Repeating property will not change. + if ((inputColVector1.isRepeating) && (inputColVector2.isRepeating)) { + // All must be selected otherwise size would be zero + // Repeating property will not change. outV.isRepeating = true; - outputVector[0] = vector1[0] | vector2[0] ; - outV.isNull[0] = (vector1[0] == 0) && inputColVector2.isNull[0]; + outputVector[0] = vector1[0] | vector2[0]; + outV.isNull[0] = (vector1[0] == 0) && inputColVector2.isNull[0]; } else if (inputColVector1.isRepeating && !inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[0] | vector2[i] ; + outputVector[i] = vector1[0] | vector2[i]; outV.isNull[i] = (vector1[0] == 0) && inputColVector2.isNull[i]; } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[0] | vector2[i]; outV.isNull[i] = (vector1[0] == 0) && inputColVector2.isNull[i]; } @@ -122,27 +126,27 @@ public void evaluate(VectorizedRowBatch batch) { outV.isRepeating = false; } else if (!inputColVector1.isRepeating && inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[i] | vector2[0] ; + outputVector[i] = vector1[i] | vector2[0]; outV.isNull[i] = (vector1[i] == 0) && inputColVector2.isNull[0]; } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[i] | vector2[0]; outV.isNull[i] = (vector1[i] == 0) && inputColVector2.isNull[0]; } } outV.isRepeating = false; - } else /* neither side is repeating */ { + } else /* neither side is repeating */{ if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[i] | vector2[i] ; + outputVector[i] = vector1[i] | vector2[i]; outV.isNull[i] = (vector1[i] == 0) && inputColVector2.isNull[i]; } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[i] | vector2[i]; outV.isNull[i] = (vector1[i] == 0) && inputColVector2.isNull[i]; } @@ -152,69 +156,69 @@ public void evaluate(VectorizedRowBatch batch) { outV.noNulls = false; } else if (!inputColVector1.noNulls && inputColVector2.noNulls) { // only input 1 side has nulls - if ( (inputColVector1.isRepeating) && (inputColVector2.isRepeating) ) { - //All must be selected otherwise size would be zero - //Repeating property will not change. + if ((inputColVector1.isRepeating) && (inputColVector2.isRepeating)) { + // All must be selected otherwise size would be zero + // Repeating property will not change. outV.isRepeating = true; - outputVector[0] = vector1[0] | vector2[0] ; - outV.isNull[0] = inputColVector1.isNull[0] && (vector2[0] == 0); + outputVector[0] = vector1[0] | vector2[0]; + outV.isNull[0] = inputColVector1.isNull[0] && (vector2[0] == 0); } else if (inputColVector1.isRepeating && !inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[0] | vector2[i] ; - outV.isNull[i] = inputColVector1.isNull[0] && (vector2[i] == 0); + outputVector[i] = vector1[0] | vector2[i]; + outV.isNull[i] = inputColVector1.isNull[0] && (vector2[i] == 0); } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[0] | vector2[i]; - outV.isNull[i] = inputColVector1.isNull[0] && (vector2[i] == 0); + outV.isNull[i] = inputColVector1.isNull[0] && (vector2[i] == 0); } } outV.isRepeating = false; } else if (!inputColVector1.isRepeating && inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[i] | vector2[0] ; - outV.isNull[i] = inputColVector1.isNull[i] && (vector2[0] == 0); + outputVector[i] = vector1[i] | vector2[0]; + outV.isNull[i] = inputColVector1.isNull[i] && (vector2[0] == 0); } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[i] | vector2[0]; - outV.isNull[i] = inputColVector1.isNull[i] && (vector2[0] == 0); + outV.isNull[i] = inputColVector1.isNull[i] && (vector2[0] == 0); } } outV.isRepeating = false; - } else /* neither side is repeating */ { + } else /* neither side is repeating */{ if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[i] | vector2[i] ; - outV.isNull[i] = inputColVector1.isNull[i] && (vector2[i] == 0); + outputVector[i] = vector1[i] | vector2[i]; + outV.isNull[i] = inputColVector1.isNull[i] && (vector2[i] == 0); } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[i] | vector2[i]; - outV.isNull[i] = inputColVector1.isNull[i] && (vector2[i] == 0); + outV.isNull[i] = inputColVector1.isNull[i] && (vector2[i] == 0); } } outV.isRepeating = false; } outV.noNulls = false; - } else /* !inputColVector1.noNulls && !inputColVector2.noNulls */ { + } else /* !inputColVector1.noNulls && !inputColVector2.noNulls */{ // either input 1 or input 2 may have nulls - if ( (inputColVector1.isRepeating) && (inputColVector2.isRepeating) ) { - //All must be selected otherwise size would be zero - //Repeating property will not change. + if ((inputColVector1.isRepeating) && (inputColVector2.isRepeating)) { + // All must be selected otherwise size would be zero + // Repeating property will not change. outV.isRepeating = true; - outputVector[0] = vector1[0] | vector2[0] ; + outputVector[0] = vector1[0] | vector2[0]; outV.isNull[0] = ((vector1[0] == 0) && inputColVector2.isNull[0]) || (inputColVector1.isNull[0] && (vector2[0] == 0)) || (inputColVector1.isNull[0] && inputColVector2.isNull[0]); } else if (inputColVector1.isRepeating && !inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; outputVector[i] = vector1[0] | vector2[i]; outV.isNull[i] = ((vector1[0] == 0) && inputColVector2.isNull[i]) @@ -222,7 +226,7 @@ public void evaluate(VectorizedRowBatch batch) { || (inputColVector1.isNull[0] && inputColVector2.isNull[i]); } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[0] | vector2[i]; outV.isNull[i] = ((vector1[0] == 0) && inputColVector2.isNull[i]) || (inputColVector1.isNull[0] && (vector2[i] == 0)) @@ -232,15 +236,15 @@ public void evaluate(VectorizedRowBatch batch) { outV.isRepeating = false; } else if (!inputColVector1.isRepeating && inputColVector2.isRepeating) { if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[i] | vector2[0] ; + outputVector[i] = vector1[i] | vector2[0]; outV.isNull[i] = ((vector1[i] == 0) && inputColVector2.isNull[0]) || (inputColVector1.isNull[i] && (vector2[0] == 0)) || (inputColVector1.isNull[i] && inputColVector2.isNull[0]); } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[i] | vector2[0]; outV.isNull[i] = ((vector1[i] == 0) && inputColVector2.isNull[0]) || (inputColVector1.isNull[i] && (vector2[0] == 0)) @@ -248,17 +252,17 @@ public void evaluate(VectorizedRowBatch batch) { } } outV.isRepeating = false; - } else /* neither side is repeating */ { + } else /* neither side is repeating */{ if (batch.selectedInUse) { - for(int j=0; j != n; j++) { + for (int j = 0; j != n; j++) { int i = sel[j]; - outputVector[i] = vector1[i] | vector2[i] ; + outputVector[i] = vector1[i] | vector2[i]; outV.isNull[i] = ((vector1[i] == 0) && inputColVector2.isNull[i]) || (inputColVector1.isNull[i] && (vector2[i] == 0)) || (inputColVector1.isNull[i] && inputColVector2.isNull[i]); } } else { - for(int i = 0; i != n; i++) { + for (int i = 0; i != n; i++) { outputVector[i] = vector1[i] | vector2[i]; outV.isNull[i] = ((vector1[i] == 0) && inputColVector2.isNull[i]) || (inputColVector1.isNull[i] && (vector2[i] == 0)) @@ -269,7 +273,7 @@ public void evaluate(VectorizedRowBatch batch) { } outV.noNulls = false; } - } + } @Override public int getOutputColumn() { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColumnExpression.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColumnExpression.java deleted file mode 100644 index 0f819f5..0000000 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColumnExpression.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hive.ql.exec.vector.expressions; - -import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - -/** - * Vector column project. It's evaluation is a no-op. - * - */ -public class ColumnExpression extends VectorExpression { - - private int colNum; - private String colType; - - public ColumnExpression(int colNum, String colType) { - this.colNum = colNum; - this.colType = colType; - } - - public void evaluate(VectorizedRowBatch vrg) { - //do nothing - } - - @Override - public int getOutputColumn() { - return colNum; - } - - @Override - public String getOutputType() { - return colType; - } -} - diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java index e0e87f1..c1c0c0d 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java @@ -23,6 +23,9 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Constant is represented as a vector with repeating values. + */ public class ConstantVectorExpression extends VectorExpression { private static enum Type { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java index 0a1e3a1..45169b2 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IdentityExpression.java @@ -19,9 +19,12 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * An expression representing a column, only children are evaluated. + */ public class IdentityExpression extends VectorExpression { - int colNum; - String type; + private final int colNum; + private final String type; public IdentityExpression(int colNum, String type) { this.colNum = colNum; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNotNull.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNotNull.java index fd5f5b5..96eb215 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNotNull.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNotNull.java @@ -26,8 +26,8 @@ * The boolean output is stored in the specified output column. */ public class IsNotNull extends VectorExpression { - int colNum; - int outputColumn; + private final int colNum; + private final int outputColumn; public IsNotNull(int colNum, int outputColumn) { this.colNum = colNum; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNull.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNull.java index a470aae..e6f5fe2 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNull.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IsNull.java @@ -26,8 +26,8 @@ * The boolean output is stored in the specified output column. */ public class IsNull extends VectorExpression { - int colNum; - int outputColumn; + private final int colNum; + private final int outputColumn; public IsNull(int colNum, int outputColumn) { this.colNum = colNum; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongColumn.java index cd6c7bc..5af6997 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongColumn.java @@ -15,12 +15,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + package org.apache.hadoop.hive.ql.exec.vector.expressions; -import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; -import org.apache.hadoop.hive.ql.exec.vector.*; +import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; +import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; /** @@ -54,24 +53,24 @@ public void evaluate(VectorizedRowBatch batch) { long[] vector1 = inputColVector1.vector; long[] vector2 = inputColVector2.vector; double[] outputVector = outputColVector.vector; - + // return immediately if batch is empty if (n == 0) { return; } - + outputColVector.isRepeating = inputColVector1.isRepeating && inputColVector2.isRepeating; - - // Handle nulls first + + // Handle nulls first NullUtil.propagateNullsColCol( inputColVector1, inputColVector2, outputColVector, sel, n, batch.selectedInUse); - + /* Disregard nulls for processing. In other words, - * the arithmetic operation is performed even if one or + * the arithmetic operation is performed even if one or * more inputs are null. This is to improve speed by avoiding * conditional checks in the inner loop. - */ - if (inputColVector1.isRepeating && inputColVector2.isRepeating) { + */ + if (inputColVector1.isRepeating && inputColVector2.isRepeating) { outputVector[0] = vector1[0] / (double) vector2[0]; } else if (inputColVector1.isRepeating) { if (batch.selectedInUse) { @@ -107,9 +106,9 @@ public void evaluate(VectorizedRowBatch batch) { } } } - - /* For the case when the output can have null values, follow - * the convention that the data values must be 1 for long and + + /* For the case when the output can have null values, follow + * the convention that the data values must be 1 for long and * NaN for double. This is to prevent possible later zero-divide errors * in complex arithmetic expressions like col2 / (col1 - 1) * in the case when some col1 entries are null. diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongScalar.java index a20cdb5..2d64e69 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColDivideLongScalar.java @@ -15,14 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + package org.apache.hadoop.hive.ql.exec.vector.expressions; -import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; -import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; +import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; -import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** * This operation is handled as a special case because Hive @@ -30,9 +28,9 @@ * from a template like the other arithmetic operations are. */ public class LongColDivideLongScalar extends VectorExpression { - private int colNum; - private long value; - private int outputColumn; + private final int colNum; + private final long value; + private final int outputColumn; public LongColDivideLongScalar(int colNum, long value, int outputColumn) { this.colNum = colNum; @@ -57,7 +55,7 @@ public void evaluate(VectorizedRowBatch batch) { int n = batch.size; long[] vector = inputColVector.vector; double[] outputVector = outputColVector.vector; - + // return immediately if batch is empty if (n == 0) { return; @@ -65,9 +63,9 @@ public void evaluate(VectorizedRowBatch batch) { if (inputColVector.isRepeating) { outputVector[0] = vector[0] / (double) value; - + // Even if there are no nulls, we always copy over entry 0. Simplifies code. - outputIsNull[0] = inputIsNull[0]; + outputIsNull[0] = inputIsNull[0]; } else if (inputColVector.noNulls) { if (batch.selectedInUse) { for(int j = 0; j != n; j++) { @@ -93,9 +91,9 @@ public void evaluate(VectorizedRowBatch batch) { System.arraycopy(inputIsNull, 0, outputIsNull, 0, n); } } - + /* Set double data vector array entries for NULL elements to the correct value. - * Unlike other col-scalar operations, this one doesn't benefit from carrying + * Unlike other col-scalar operations, this one doesn't benefit from carrying * over NaN values from the input array. */ NullUtil.setNullDataEntriesDouble(outputColVector, batch.selectedInUse, sel, n); @@ -105,7 +103,7 @@ public void evaluate(VectorizedRowBatch batch) { public int getOutputColumn() { return outputColumn; } - + @Override public String getOutputType() { return "double"; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarDivideLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarDivideLongColumn.java index cbc7d48..cfa3cf4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarDivideLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarDivideLongColumn.java @@ -15,14 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + package org.apache.hadoop.hive.ql.exec.vector.expressions; -import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; -import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; +import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; -import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** * This operation is handled as a special case because Hive @@ -30,9 +28,9 @@ * from a template like the other arithmetic operations are. */ public class LongScalarDivideLongColumn extends VectorExpression { - private int colNum; + private final int colNum; private final double value; - private int outputColumn; + private final int outputColumn; public LongScalarDivideLongColumn(long value, int colNum, int outputColumn) { this.colNum = colNum; @@ -57,7 +55,7 @@ public void evaluate(VectorizedRowBatch batch) { int n = batch.size; long[] vector = inputColVector.vector; double[] outputVector = outputColVector.vector; - + // return immediately if batch is empty if (n == 0) { return; @@ -65,9 +63,9 @@ public void evaluate(VectorizedRowBatch batch) { if (inputColVector.isRepeating) { outputVector[0] = value / vector[0]; - + // Even if there are no nulls, we always copy over entry 0. Simplifies code. - outputIsNull[0] = inputIsNull[0]; + outputIsNull[0] = inputIsNull[0]; } else if (inputColVector.noNulls) { if (batch.selectedInUse) { for(int j = 0; j != n; j++) { @@ -93,9 +91,9 @@ public void evaluate(VectorizedRowBatch batch) { System.arraycopy(inputIsNull, 0, outputIsNull, 0, n); } } - + /* Set double data vector array entries for NULL elements to the correct value. - * Unlike other col-scalar operations, this one doesn't benefit from carrying + * Unlike other col-scalar operations, this one doesn't benefit from carrying * over NaN values from the input array. */ NullUtil.setNullDataEntriesDouble(outputColVector, batch.selectedInUse, sel, n); @@ -105,7 +103,7 @@ public void evaluate(VectorizedRowBatch batch) { public int getOutputColumn() { return outputColumn; } - + @Override public String getOutputType() { return "double"; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringExpr.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringExpr.java index 90dd7da..92beb93 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringExpr.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringExpr.java @@ -18,21 +18,21 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions; -/** - * String expression evaluation helper functions +/** + * String expression evaluation helper functions. */ public class StringExpr { - - /* Compare two strings from two byte arrays each - * with their own start position and length. - * Use lexicographic unsigned byte value order. + + /* Compare two strings from two byte arrays each + * with their own start position and length. + * Use lexicographic unsigned byte value order. * This is what's used for UTF-8 sort order. - * Return negative value if arg1 < arg2, 0 if arg1 = arg2, + * Return negative value if arg1 < arg2, 0 if arg1 = arg2, * positive if arg1 > arg2. */ public static int compare(byte[] arg1, int start1, int len1, byte[] arg2, int start2, int len2) { for (int i = 0; i < len1 && i < len2; i++) { - int b1 = arg1[i + start1] & 0xff; + int b1 = arg1[i + start1] & 0xff; int b2 = arg2[i + start2] & 0xff; if (b1 != b2) { return b1 - b2; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLength.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLength.java index 32b4d4b..dc79ff1 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLength.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLength.java @@ -22,11 +22,15 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Calculate the length of the strings in the input column vector, and store + * it in the output column vector. + */ public class StringLength extends VectorExpression { - private int colNum; - private int outputColumn; - - public StringLength (int colNum, int outputColumn) { + private final int colNum; + private final int outputColumn; + + public StringLength(int colNum, int outputColumn) { this.colNum = colNum; this.outputColumn = outputColumn; } @@ -34,45 +38,44 @@ public StringLength (int colNum, int outputColumn) { // Calculate the length of the UTF-8 strings in input vector and place results in output vector. @Override public void evaluate(VectorizedRowBatch batch) { - + if (childExpressions != null) { super.evaluateChildren(batch); } - + BytesColumnVector inputColVector = (BytesColumnVector) batch.cols[colNum]; - LongColumnVector outV = (LongColumnVector) batch.cols[outputColumn]; + LongColumnVector outV = (LongColumnVector) batch.cols[outputColumn]; int[] sel = batch.selected; int n = batch.size; byte[][] vector = inputColVector.vector; - int start[] = inputColVector.start; - int length[] = inputColVector.length; - long[] resultLen = outV.vector; - + int [] start = inputColVector.start; + int [] length = inputColVector.length; + long[] resultLen = outV.vector; + if (n == 0) { - //Nothing to do return; } - + if (inputColVector.noNulls) { outV.noNulls = true; if (inputColVector.isRepeating) { outV.isRepeating = true; - resultLen[0] = UTF8StringLength(vector[0], start[0], length[0]); + resultLen[0] = utf8StringLength(vector[0], start[0], length[0]); } else if (batch.selectedInUse) { for(int j = 0; j != n; j++) { int i = sel[j]; - resultLen[i] = UTF8StringLength(vector[i], start[i], length[i]); + resultLen[i] = utf8StringLength(vector[i], start[i], length[i]); } outV.isRepeating = false; } else { for(int i = 0; i != n; i++) { - resultLen[i] = UTF8StringLength(vector[i], start[i], length[i]); + resultLen[i] = utf8StringLength(vector[i], start[i], length[i]); } outV.isRepeating = false; } } else { - + /* * Handle case with nulls. Don't do function if the value is null, to save time, * because calling the function can be expensive. @@ -82,13 +85,13 @@ public void evaluate(VectorizedRowBatch batch) { outV.isRepeating = true; outV.isNull[0] = inputColVector.isNull[0]; if (!inputColVector.isNull[0]) { - resultLen[0] = UTF8StringLength(vector[0], start[0], length[0]); + resultLen[0] = utf8StringLength(vector[0], start[0], length[0]); } } else if (batch.selectedInUse) { for(int j = 0; j != n; j++) { int i = sel[j]; if (!inputColVector.isNull[i]) { - resultLen[i] = UTF8StringLength(vector[i], start[i], length[i]); + resultLen[i] = utf8StringLength(vector[i], start[i], length[i]); } outV.isNull[i] = inputColVector.isNull[i]; } @@ -96,7 +99,7 @@ public void evaluate(VectorizedRowBatch batch) { } else { for(int i = 0; i != n; i++) { if (!inputColVector.isNull[i]) { - resultLen[i] = UTF8StringLength(vector[i], start[i], length[i]); + resultLen[i] = utf8StringLength(vector[i], start[i], length[i]); } outV.isNull[i] = inputColVector.isNull[i]; } @@ -104,22 +107,21 @@ public void evaluate(VectorizedRowBatch batch) { } } } - - /* + + /* * Return length in characters of UTF8 string in byte array * beginning at start that is len bytes long. */ - static long UTF8StringLength(byte[] s, int start, int len) - { + static long utf8StringLength(byte[] s, int start, int len) { long resultLength = 0; for (int i = start; i < start + len; i++) { - - /* Byte bit patterns of the form 10xxxxxx are continuation - * bytes. All other bit patterns are the first byte of + + /* Byte bit patterns of the form 10xxxxxx are continuation + * bytes. All other bit patterns are the first byte of * a character. */ if ((s[i] & 0xc0) != 0x80) { - resultLength++; + resultLength++; } } return resultLength; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLower.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLower.java index 19e14f3..a93137c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLower.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLower.java @@ -15,11 +15,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.hadoop.hive.ql.exec.vector.expressions; -import org.apache.hadoop.hive.ql.udf.UDFLower; import org.apache.hadoop.hive.ql.udf.IUDFUnaryString; +import org.apache.hadoop.hive.ql.udf.UDFLower; +/** + * Expression to convert a string to lower case. + * Extends {@link StringUnaryUDF}. + */ public class StringLower extends StringUnaryUDF { public StringLower(int colNum, int outputColumn) { super(colNum, outputColumn, (IUDFUnaryString) new UDFLower()); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStart.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStart.java index 37610f1..dbf0196 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStart.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStart.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.hadoop.hive.ql.exec.vector.expressions; import java.io.UnsupportedEncodingException; @@ -6,19 +24,21 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; /** - * This class provides the implementation of vectorized substring, with a single start index parameter. - * If the start index is invalid (outside of the string boundaries) then an empty string will be in the output. + * This class provides the implementation of vectorized substring, with a single start index + * parameter. If the start index is invalid (outside of the string boundaries) then an empty + * string will be in the output. */ public class StringSubstrColStart extends VectorExpression { private final int startIdx; private final int colNum; private final int outputColumn; - private static byte[] EMPTY_STRING; + private static byte[] EMPTYSTRING; - // Populating the Empty string bytes. Putting it as static since it should be immutable and can be shared + // Populating the Empty string bytes. Putting it as static since it should be immutable and can + // be shared. static { try { - EMPTY_STRING = "".getBytes("UTF-8"); + EMPTYSTRING = "".getBytes("UTF-8"); } catch(UnsupportedEncodingException e) { e.printStackTrace(); } @@ -31,8 +51,8 @@ public StringSubstrColStart(int colNum, int startIdx, int outputColumn) { } /** - * Given the substring start index param it finds the starting offset of the passed in utf8 string byte array - * that matches the index. + * Given the substring start index param it finds the starting offset of the passed in utf8 + * string byte array that matches the index. * @param utf8String byte array that holds the utf8 string * @param start start offset of the byte array the string starts at * @param len length of the bytes the string holds in the byte array @@ -94,7 +114,7 @@ public void evaluate(VectorizedRowBatch batch) { if (!inV.noNulls && inV.isNull[0]) { outV.isNull[0] = true; outV.noNulls = false; - outV.setRef(0, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(0, EMPTYSTRING, 0, EMPTYSTRING.length); return; } else { outV.noNulls = true; @@ -102,7 +122,7 @@ public void evaluate(VectorizedRowBatch batch) { if (offset != -1) { outV.setRef(0, vector[0], offset, len[0] - offset); } else { - outV.setRef(0, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(0, EMPTYSTRING, 0, EMPTYSTRING.length); } } } else { @@ -113,12 +133,13 @@ public void evaluate(VectorizedRowBatch batch) { for (int i = 0; i != n; ++i) { int selected = sel[i]; if (!inV.isNull[selected]) { - int offset = getSubstrStartOffset(vector[selected], start[selected], len[selected], startIdx); + int offset = getSubstrStartOffset(vector[selected], start[selected], len[selected], + startIdx); outV.isNull[selected] = false; if (offset != -1) { outV.setRef(selected, vector[selected], offset, len[selected] - offset); } else { - outV.setRef(selected, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(selected, EMPTYSTRING, 0, EMPTYSTRING.length); } } else { outV.isNull[selected] = true; @@ -128,11 +149,12 @@ public void evaluate(VectorizedRowBatch batch) { outV.noNulls = true; for (int i = 0; i != n; ++i) { int selected = sel[i]; - int offset = getSubstrStartOffset(vector[selected], start[selected], len[selected], startIdx); + int offset = getSubstrStartOffset(vector[selected], start[selected], len[selected], + startIdx); if (offset != -1) { outV.setRef(selected, vector[selected], offset, len[selected] - offset); } else { - outV.setRef(selected, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(selected, EMPTYSTRING, 0, EMPTYSTRING.length); } } } @@ -146,7 +168,7 @@ public void evaluate(VectorizedRowBatch batch) { if (offset != -1) { outV.setRef(i, vector[i], offset, len[i] - offset); } else { - outV.setRef(i, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(i, EMPTYSTRING, 0, EMPTYSTRING.length); } } } @@ -157,7 +179,7 @@ public void evaluate(VectorizedRowBatch batch) { if (offset != -1) { outV.setRef(i, vector[i], offset, len[i] - offset); } else { - outV.setRef(i, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(i, EMPTYSTRING, 0, EMPTYSTRING.length); } } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStartLen.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStartLen.java index 5864375..c48355e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStartLen.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStartLen.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.hadoop.hive.ql.exec.vector.expressions; import java.io.UnsupportedEncodingException; @@ -6,9 +24,11 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; /** - * This class provides the implementation of vectorized substring, with a start index and length parameters. - * If the start index is invalid (outside of the string boundaries) then an empty string will be in the output. - * If the length provided is longer then the string boundary, then it will replace it with the ending index. + * This class provides the implementation of vectorized substring, with a start index and length + * parameters. If the start index is invalid (outside of the string boundaries) then an empty + * string will be in the output. + * If the length provided is longer then the string boundary, then it will replace it with the + * ending index. */ public class StringSubstrColStartLen extends VectorExpression { private final int startIdx; @@ -16,12 +36,13 @@ private final int length; private final int outputColumn; private final int[] offsetArray; - private static byte[] EMPTY_STRING; + private static byte[] EMPTYSTRING; - // Populating the Empty string bytes. Putting it as static since it should be immutable and can be shared + // Populating the Empty string bytes. Putting it as static since it should be immutable and can be + // shared static { try { - EMPTY_STRING = "".getBytes("UTF-8"); + EMPTYSTRING = "".getBytes("UTF-8"); } catch(UnsupportedEncodingException e) { e.printStackTrace(); } @@ -45,7 +66,8 @@ public StringSubstrColStartLen(int colNum, int startIdx, int length, int outputC * @param substrLen the length of the substring * @param offsetArray the array that indexes are populated to. Assume its length >= 2. */ - static void populateSubstrOffsets(byte[] utf8String, int start, int len, int substrStart, int substrLength, int[] offsetArray) { + static void populateSubstrOffsets(byte[] utf8String, int start, int len, int substrStart, + int substrLength, int[] offsetArray) { int curIdx = -1; offsetArray[0] = -1; offsetArray[1] = -1; @@ -109,7 +131,7 @@ public void evaluate(VectorizedRowBatch batch) { if (!inV.noNulls && inV.isNull[0]) { outV.isNull[0] = true; outV.noNulls = false; - outV.setRef(0, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(0, EMPTYSTRING, 0, EMPTYSTRING.length); return; } else { outV.noNulls = true; @@ -117,7 +139,7 @@ public void evaluate(VectorizedRowBatch batch) { if (offsetArray[0] != -1) { outV.setRef(0, vector[0], offsetArray[0], offsetArray[1]); } else { - outV.setRef(0, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(0, EMPTYSTRING, 0, EMPTYSTRING.length); } } } else { @@ -129,11 +151,12 @@ public void evaluate(VectorizedRowBatch batch) { int selected = sel[i]; if (!inV.isNull[selected]) { outV.isNull[selected] = false; - populateSubstrOffsets(vector[selected], start[selected], len[selected], startIdx, length, offsetArray); + populateSubstrOffsets(vector[selected], start[selected], len[selected], startIdx, + length, offsetArray); if (offsetArray[0] != -1) { outV.setRef(selected, vector[selected], offsetArray[0], offsetArray[1]); } else { - outV.setRef(selected, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(selected, EMPTYSTRING, 0, EMPTYSTRING.length); } } else { outV.isNull[selected] = true; @@ -144,11 +167,12 @@ public void evaluate(VectorizedRowBatch batch) { for (int i = 0; i != n; ++i) { int selected = sel[i]; outV.isNull[selected] = false; - populateSubstrOffsets(vector[selected], start[selected], len[selected], startIdx, length, offsetArray); + populateSubstrOffsets(vector[selected], start[selected], len[selected], startIdx, + length, offsetArray); if (offsetArray[0] != -1) { outV.setRef(selected, vector[selected], offsetArray[0], offsetArray[1]); } else { - outV.setRef(selected, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(selected, EMPTYSTRING, 0, EMPTYSTRING.length); } } } @@ -162,7 +186,7 @@ public void evaluate(VectorizedRowBatch batch) { if (offsetArray[0] != -1) { outV.setRef(i, vector[i], offsetArray[0], offsetArray[1]); } else { - outV.setRef(i, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(i, EMPTYSTRING, 0, EMPTYSTRING.length); } } } @@ -174,7 +198,7 @@ public void evaluate(VectorizedRowBatch batch) { if (offsetArray[0] != -1) { outV.setRef(i, vector[i], offsetArray[0], offsetArray[1]); } else { - outV.setRef(i, EMPTY_STRING, 0, EMPTY_STRING.length); + outV.setRef(i, EMPTYSTRING, 0, EMPTYSTRING.length); } } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUnaryUDF.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUnaryUDF.java index 5b66d86..23b909a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUnaryUDF.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUnaryUDF.java @@ -15,21 +15,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.hadoop.hive.ql.exec.vector.expressions; import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; -import org.apache.hadoop.io.Text; import org.apache.hadoop.hive.ql.udf.IUDFUnaryString; +import org.apache.hadoop.io.Text; +/** + * Expression for vectorized evaluation of unary UDFs on strings. + * An object of {@link IUDFUnaryString} is applied to every element of + * the vector. + */ public class StringUnaryUDF extends VectorExpression { - - int colNum; - int outputColumn; - IUDFUnaryString func; - Text s; - - StringUnaryUDF (int colNum, int outputColumn, IUDFUnaryString func) { + private final int colNum; + private final int outputColumn; + private final IUDFUnaryString func; + private final Text s; + + StringUnaryUDF(int colNum, int outputColumn, IUDFUnaryString func) { this.colNum = colNum; this.outputColumn = outputColumn; this.func = func; @@ -38,56 +43,55 @@ @Override public void evaluate(VectorizedRowBatch batch) { - + if (childExpressions != null) { super.evaluateChildren(batch); } - + BytesColumnVector inputColVector = (BytesColumnVector) batch.cols[colNum]; int[] sel = batch.selected; int n = batch.size; byte[][] vector = inputColVector.vector; - int start[] = inputColVector.start; - int length[] = inputColVector.length; + int [] start = inputColVector.start; + int [] length = inputColVector.length; BytesColumnVector outV = (BytesColumnVector) batch.cols[outputColumn]; - byte[][] outputVector = outV.vector; Text t; - + if (n == 0) { //Nothing to do return; } - + // Design Note: In the future, if this function can be implemented // directly to translate input to output without creating new // objects, performance can probably be improved significantly. - // It's implemented in the simplest way now, just calling the + // It's implemented in the simplest way now, just calling the // existing built-in function. if (inputColVector.noNulls) { outV.noNulls = true; if (inputColVector.isRepeating) { outV.isRepeating = true; - s.set(vector[0], start[0], length[0]); + s.set(vector[0], start[0], length[0]); t = func.evaluate(s); outV.setRef(0, t.getBytes(), 0, t.getLength()); } else if (batch.selectedInUse) { for(int j=0; j != n; j++) { int i = sel[j]; - s.set(vector[i], start[i], length[i]); + s.set(vector[i], start[i], length[i]); t = func.evaluate(s); outV.setRef(i, t.getBytes(), 0, t.getLength()); } outV.isRepeating = false; } else { for(int i = 0; i != n; i++) { - s.set(vector[i], start[i], length[i]); + s.set(vector[i], start[i], length[i]); t = func.evaluate(s); outV.setRef(i, t.getBytes(), 0, t.getLength()); } outV.isRepeating = false; } - } else { + } else { // Handle case with nulls. Don't do function if the value is null, to save time, // because calling the function can be expensive. outV.noNulls = false; @@ -95,7 +99,7 @@ public void evaluate(VectorizedRowBatch batch) { outV.isRepeating = true; outV.isNull[0] = inputColVector.isNull[0]; if (!inputColVector.isNull[0]) { - s.set(vector[0], start[0], length[0]); + s.set(vector[0], start[0], length[0]); t = func.evaluate(s); outV.setRef(0, t.getBytes(), 0, t.getLength()); } @@ -103,7 +107,7 @@ public void evaluate(VectorizedRowBatch batch) { for(int j=0; j != n; j++) { int i = sel[j]; if (!inputColVector.isNull[i]) { - s.set(vector[i], start[i], length[i]); + s.set(vector[i], start[i], length[i]); t = func.evaluate(s); outV.setRef(i, t.getBytes(), 0, t.getLength()); } @@ -113,7 +117,7 @@ public void evaluate(VectorizedRowBatch batch) { } else { for(int i = 0; i != n; i++) { if (!inputColVector.isNull[i]) { - s.set(vector[i], start[i], length[i]); + s.set(vector[i], start[i], length[i]); t = func.evaluate(s); outV.setRef(i, t.getBytes(), 0, t.getLength()); } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUpper.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUpper.java index 126d183..c5e748b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUpper.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringUpper.java @@ -18,9 +18,13 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions; -import org.apache.hadoop.hive.ql.udf.UDFUpper; import org.apache.hadoop.hive.ql.udf.IUDFUnaryString; +import org.apache.hadoop.hive.ql.udf.UDFUpper; +/** + * Expression to convert a string to lower case. + * Extends {@link StringUnaryUDF}. + */ public class StringUpper extends StringUnaryUDF { public StringUpper(int colNum, int outputColumn) { super(colNum, outputColumn, (IUDFUnaryString) new UDFUpper()); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFDayOfMonthLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFDayOfMonthLong.java index 60ab2b1..08e6d24 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFDayOfMonthLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFDayOfMonthLong.java @@ -20,11 +20,14 @@ import java.util.Calendar; - +/** + * Expression to get day of month. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFDayOfMonthLong extends VectorUDFTimestampFieldLong { public VectorUDFDayOfMonthLong(int colNum, int outputColumn) { - super(Calendar.DAY_OF_MONTH, colNum,outputColumn); + super(Calendar.DAY_OF_MONTH, colNum, outputColumn); } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFHourLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFHourLong.java index 9b05476..0107510 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFHourLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFHourLong.java @@ -20,11 +20,14 @@ import java.util.Calendar; - +/** + * Returns hour of day. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFHourLong extends VectorUDFTimestampFieldLong { public VectorUDFHourLong(int colNum, int outputColumn) { - super(Calendar.HOUR_OF_DAY, colNum,outputColumn); + super(Calendar.HOUR_OF_DAY, colNum, outputColumn); } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMinuteLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMinuteLong.java index 8589c3c..17ea01b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMinuteLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMinuteLong.java @@ -20,11 +20,14 @@ import java.util.Calendar; - +/** + * Returns minute value. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFMinuteLong extends VectorUDFTimestampFieldLong { public VectorUDFMinuteLong(int colNum, int outputColumn) { - super(Calendar.MINUTE, colNum,outputColumn); + super(Calendar.MINUTE, colNum, outputColumn); } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMonthLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMonthLong.java index 5057060..e547c1f 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMonthLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMonthLong.java @@ -20,11 +20,14 @@ import java.util.Calendar; - +/** + * Returns month value. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFMonthLong extends VectorUDFTimestampFieldLong { public VectorUDFMonthLong(int colNum, int outputColumn) { - super(Calendar.MONTH, colNum,outputColumn); + super(Calendar.MONTH, colNum, outputColumn); } @Override diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFSecondLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFSecondLong.java index b11f1f0..4a85caf 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFSecondLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFSecondLong.java @@ -20,11 +20,14 @@ import java.util.Calendar; - +/** + * Expression to get seconds. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFSecondLong extends VectorUDFTimestampFieldLong { public VectorUDFSecondLong(int colNum, int outputColumn) { - super(Calendar.SECOND, colNum,outputColumn); + super(Calendar.SECOND, colNum, outputColumn); } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFTimestampFieldLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFTimestampFieldLong.java index 36ad0ad..d671731 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFTimestampFieldLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFTimestampFieldLong.java @@ -24,8 +24,9 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - - +/** + * Abstract class to return various fields from a Timestamp. + */ public abstract class VectorUDFTimestampFieldLong extends VectorExpression { protected final int colNum; @@ -91,7 +92,7 @@ public void evaluate(VectorizedRowBatch batch) { if (inputCol.noNulls) { outV.noNulls = true; if (batch.selectedInUse) { - for(int j=0; j < n ; j++) { + for(int j=0; j < n; j++) { int i = sel[j]; outV.vector[i] = getField(inputCol.vector[i]); } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFUnixTimeStampLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFUnixTimeStampLong.java index 95e2c6d..ee20830 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFUnixTimeStampLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFUnixTimeStampLong.java @@ -18,8 +18,10 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions; - - +/** + * Return Unix Timestamp. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFUnixTimeStampLong extends VectorUDFTimestampFieldLong { @Override @@ -35,7 +37,7 @@ protected long getField(long time) { public VectorUDFUnixTimeStampLong(int colNum, int outputColumn) { /* not a real field */ - super(-1, colNum,outputColumn); + super(-1, colNum, outputColumn); } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFWeekOfYearLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFWeekOfYearLong.java index a60a086..91f0703 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFWeekOfYearLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFWeekOfYearLong.java @@ -20,11 +20,14 @@ import java.util.Calendar; - +/** + * Expression to get week of year. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFWeekOfYearLong extends VectorUDFTimestampFieldLong { public VectorUDFWeekOfYearLong(int colNum, int outputColumn) { - super(Calendar.WEEK_OF_YEAR, colNum,outputColumn); + super(Calendar.WEEK_OF_YEAR, colNum, outputColumn); /* code copied over from UDFWeekOfYear implementation */ calendar.setFirstDayOfWeek(Calendar.MONDAY); calendar.setMinimalDaysInFirstWeek(4); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFYearLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFYearLong.java index 852008d..1d82f09 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFYearLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFYearLong.java @@ -21,40 +21,43 @@ import java.util.Arrays; import java.util.Calendar; - +/** + * Expression to get year as a long. + * Extends {@link VectorUDFTimestampFieldLong} + */ public final class VectorUDFYearLong extends VectorUDFTimestampFieldLong { /* year boundaries in nanoseconds */ - static final long[] yearBoundaries; - static final int minYear = 1901; - static final int maxYear = 2038; + static final long[] YEAR_BOUNDARIES; + static final int MIN_YEAR = 1901; + static final int MAX_YEAR = 2038; static { - yearBoundaries = new long[maxYear-minYear]; + YEAR_BOUNDARIES = new long[MAX_YEAR-MIN_YEAR]; Calendar c = Calendar.getInstance(); c.setTimeInMillis(0); // c.set doesn't reset millis /* 1901 Jan is not with in range */ - for(int year=minYear+1; year <= 2038; year++) { + for(int year=MIN_YEAR+1; year <= 2038; year++) { c.set(year, Calendar.JANUARY, 1, 0, 0, 0); - yearBoundaries[year-minYear-1] = c.getTimeInMillis()*1000*1000; + YEAR_BOUNDARIES[year-MIN_YEAR-1] = c.getTimeInMillis()*1000*1000; } } @Override protected long getField(long time) { /* binarySearch is faster than a loop doing a[i] (no array out of bounds checks) */ - int year = Arrays.binarySearch(yearBoundaries, time); + int year = Arrays.binarySearch(YEAR_BOUNDARIES, time); if(year >= 0) { /* 0 == 1902 etc */ - return minYear + 1 + year; + return MIN_YEAR + 1 + year; } else { /* -1 == 1901, -2 == 1902 */ - return minYear - 1 - year; + return MIN_YEAR - 1 - year; } } public VectorUDFYearLong(int colNum, int outputColumn) { - super(Calendar.YEAR, colNum,outputColumn); + super(Calendar.YEAR, colNum, outputColumn); } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorAggregateExpression.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorAggregateExpression.java index c56cb11..6ca2312 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorAggregateExpression.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorAggregateExpression.java @@ -24,8 +24,14 @@ import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; +/** + * Base class for aggregation expressions. + */ public abstract class VectorAggregateExpression { + /** + * Buffer interface to store aggregates. + */ public static interface AggregationBuffer { int getVariableSize(); }; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCount.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCount.java index 4baee1a..8fc6b64 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCount.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCount.java @@ -32,17 +32,17 @@ /** -* VectorUDAFCountLong. Vectorized implementation for COUNT aggregates. -*/ + * VectorUDAFCountLong. Vectorized implementation for COUNT aggregates. + */ @Description(name = "count", value = "_FUNC_(expr) - Returns the count (vectorized)") public class VectorUDAFCount extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static class Aggregation implements AggregationBuffer { - long value; - boolean isNull; + private long value; + private boolean isNull; public void initIfNull() { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCountStar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCountStar.java index 38cfb6e..09adb97 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCountStar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFCountStar.java @@ -30,17 +30,17 @@ import org.apache.hadoop.io.LongWritable; /** -* VectorUDAFCountStar. Vectorized implementation for COUNT(*) aggregates. -*/ + * VectorUDAFCountStar. Vectorized implementation for COUNT(*) aggregates. + */ @Description(name = "count", value = "_FUNC_(expr) - Returns count(*) (vectorized)") public class VectorUDAFCountStar extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static class Aggregation implements AggregationBuffer { - long value; - boolean isNull; + private long value; + private boolean isNull; @Override public int getVariableSize() { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgDouble.java index c15388a..a9b8d4a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgDouble.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,25 +35,21 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; -import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; -import org.apache.hadoop.hive.ql.io.orc.*; - -@Description(name = "avg", value = "_FUNC_(expr) - Returns the average value of expr (vectorized, type: double)") +/** + * Generated from template VectorUDAFAvg.txt. + */ +@Description(name = "avg", + value = "_FUNC_(expr) - Returns the average value of expr (vectorized, type: double)") public class VectorUDAFAvgDouble extends VectorAggregateExpression { /** class for storing the current aggregate value. */ static class Aggregation implements AggregationBuffer { - double sum; - long count; - boolean isNull; + private double sum; + private long count; + private boolean isNull; public void sumValue(double value) { if (isNull) { @@ -91,10 +87,10 @@ public VectorUDAFAvgDouble(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); soi = ObjectInspectorFactory.getStandardStructObjectInspector(fname, foi); @@ -291,11 +287,13 @@ private void iterateHasNullsWithAggregationSelection( @Override - public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException { + public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) + throws HiveException { inputExpression.evaluate(batch); - DoubleColumnVector inputVector = (DoubleColumnVector)batch.cols[this.inputExpression.getOutputColumn()]; + DoubleColumnVector inputVector = + (DoubleColumnVector)batch.cols[this.inputExpression.getOutputColumn()]; int batchSize = batch.size; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgLong.java index dcd7ee0..9322aaf 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFAvgLong.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,25 +35,21 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; -import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; -import org.apache.hadoop.hive.ql.io.orc.*; - -@Description(name = "avg", value = "_FUNC_(expr) - Returns the average value of expr (vectorized, type: long)") +/** + * Generated from template VectorUDAFAvg.txt. + */ +@Description(name = "avg", + value = "_FUNC_(expr) - Returns the average value of expr (vectorized, type: long)") public class VectorUDAFAvgLong extends VectorAggregateExpression { /** class for storing the current aggregate value. */ static class Aggregation implements AggregationBuffer { - double sum; - long count; - boolean isNull; + private double sum; + private long count; + private boolean isNull; public void sumValue(long value) { if (isNull) { @@ -91,10 +87,10 @@ public VectorUDAFAvgLong(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); soi = ObjectInspectorFactory.getStandardStructObjectInspector(fname, foi); @@ -291,11 +287,13 @@ private void iterateHasNullsWithAggregationSelection( @Override - public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException { + public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) + throws HiveException { inputExpression.evaluate(batch); - LongColumnVector inputVector = (LongColumnVector)batch.cols[this.inputExpression.getOutputColumn()]; + LongColumnVector inputVector = + (LongColumnVector)batch.cols[this.inputExpression.getOutputColumn()]; int batchSize = batch.size; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxDouble.java index fa075d0..fd3d051 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxDouble.java @@ -18,13 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates. - VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriter; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriterFactory; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; @@ -34,30 +30,21 @@ import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.ql.util.JavaDataModel; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFMaxDouble. Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "max", value = "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: double)") +@Description(name = "max", + value = "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: double)") public class VectorUDAFMaxDouble extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - double value; - boolean isNull; + private double value; + private boolean isNull; public void checkValue(double value) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxLong.java index 909b44a..85fb7f9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxLong.java @@ -18,13 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates. - VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriter; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriterFactory; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; @@ -34,30 +30,21 @@ import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.ql.util.JavaDataModel; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFMaxLong. Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "max", value = "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: long)") +@Description(name = "max", + value = "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: long)") public class VectorUDAFMaxLong extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - long value; - boolean isNull; + private long value; + private boolean isNull; public void checkValue(long value) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxString.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxString.java index b45b9b0..a26e42d 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxString.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMaxString.java @@ -24,7 +24,6 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.StringExpr; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector; @@ -32,30 +31,25 @@ import org.apache.hadoop.hive.ql.util.JavaDataModel; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; import org.apache.hadoop.io.Text; /** * VectorUDAFMaxString. Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "max", value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)") +@Description(name = "max", + value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)") public class VectorUDAFMaxString extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - final static int MIN_BUFFER_SIZE = 16; - byte[] bytes = new byte[MIN_BUFFER_SIZE]; - int length; - boolean isNull; + private final static int MIN_BUFFER_SIZE = 16; + private byte[] bytes = new byte[MIN_BUFFER_SIZE]; + private int length; + private boolean isNull; public void checkValue(byte[] bytes, int start, int length) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinDouble.java index af62415..d32e816 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinDouble.java @@ -18,13 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates. - VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriter; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriterFactory; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; @@ -34,30 +30,21 @@ import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.ql.util.JavaDataModel; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFMinDouble. Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "min", value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: double)") +@Description(name = "min", + value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: double)") public class VectorUDAFMinDouble extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - double value; - boolean isNull; + private double value; + private boolean isNull; public void checkValue(double value) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinLong.java index 5d0a6e5..25f6005 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinLong.java @@ -18,13 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates. - VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriter; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriterFactory; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; @@ -34,30 +30,21 @@ import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.ql.util.JavaDataModel; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFMinLong. Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "min", value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: long)") +@Description(name = "min", + value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: long)") public class VectorUDAFMinLong extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - long value; - boolean isNull; + private long value; + private boolean isNull; public void checkValue(long value) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinString.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinString.java index 37828a1..4f8907a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinString.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFMinString.java @@ -24,7 +24,6 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.StringExpr; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector; @@ -32,30 +31,25 @@ import org.apache.hadoop.hive.ql.util.JavaDataModel; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; import org.apache.hadoop.io.Text; /** * VectorUDAFMinString. Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "min", value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)") +@Description(name = "min", + value = "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)") public class VectorUDAFMinString extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - final static int MIN_BUFFER_SIZE = 16; - byte[] bytes = new byte[MIN_BUFFER_SIZE]; - int length; - boolean isNull; + private final static int MIN_BUFFER_SIZE = 16; + private byte[] bytes = new byte[MIN_BUFFER_SIZE]; + private int length; + private boolean isNull; public void checkValue(byte[] bytes, int start, int length) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopDouble.java index ce42ce0..531feaa 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopDouble.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFStdPopDouble. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "std,stddev,stddev_pop", value = "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, double)") +@Description(name = "std,stddev,stddev_pop", + value = "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, double)") public class VectorUDAFStdPopDouble extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFStdPopDouble(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopLong.java index 9295b1a..f47a9fa 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdPopLong.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFStdPopLong. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "std,stddev,stddev_pop", value = "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, long)") +@Description(name = "std,stddev,stddev_pop", + value = "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, long)") public class VectorUDAFStdPopLong extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFStdPopLong(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampDouble.java index e5f590c..b6b8163 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampDouble.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFStdSampDouble. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "stddev_samp", value = "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, double)") +@Description(name = "stddev_samp", + value = "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, double)") public class VectorUDAFStdSampDouble extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFStdSampDouble(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampLong.java index faa4bd6..9dd1ab4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFStdSampLong.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFStdSampLong. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "stddev_samp", value = "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, long)") +@Description(name = "stddev_samp", + value = "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, long)") public class VectorUDAFStdSampLong extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFStdSampLong(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumDouble.java index 17dcc91..d2082c7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumDouble.java @@ -18,12 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -34,27 +31,21 @@ import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFSumDouble. Vectorized implementation for SUM aggregates. */ -@Description(name = "sum", value = "_FUNC_(expr) - Returns the sum value of expr (vectorized, type: double)") +@Description(name = "sum", + value = "_FUNC_(expr) - Returns the sum value of expr (vectorized, type: double)") public class VectorUDAFSumDouble extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ private static final class Aggregation implements AggregationBuffer { - double sum; - boolean isNull; + private double sum; + private boolean isNull; public void sumValue(double value) { if (isNull) { @@ -71,8 +62,8 @@ public int getVariableSize() { } } - VectorExpression inputExpression; - private DoubleWritable result; + private final VectorExpression inputExpression; + private final DoubleWritable result; public VectorUDAFSumDouble(VectorExpression inputExpression) { super(); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumLong.java index f3f4bbb..abc6752 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFSumLong.java @@ -18,12 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -34,27 +31,21 @@ import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFSumLong. Vectorized implementation for SUM aggregates. */ -@Description(name = "sum", value = "_FUNC_(expr) - Returns the sum value of expr (vectorized, type: long)") +@Description(name = "sum", + value = "_FUNC_(expr) - Returns the sum value of expr (vectorized, type: long)") public class VectorUDAFSumLong extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ private static final class Aggregation implements AggregationBuffer { - long sum; - boolean isNull; + private long sum; + private boolean isNull; public void sumValue(long value) { if (isNull) { @@ -71,8 +62,8 @@ public int getVariableSize() { } } - VectorExpression inputExpression; - private LongWritable result; + private final VectorExpression inputExpression; + private final LongWritable result; public VectorUDAFSumLong(VectorExpression inputExpression) { super(); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopDouble.java index 5ebcd28..a7023e7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopDouble.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFVarPopDouble. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "variance, var_pop", value = "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, double)") +@Description(name = "variance, var_pop", + value = "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, double)") public class VectorUDAFVarPopDouble extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFVarPopDouble(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopLong.java index 558fcbc..c3eb8f4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarPopLong.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFVarPopLong. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "variance, var_pop", value = "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, long)") +@Description(name = "variance, var_pop", + value = "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, long)") public class VectorUDAFVarPopLong extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFVarPopLong(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampDouble.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampDouble.java index 11f7cae..784110f 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampDouble.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampDouble.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFVarSampDouble. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "var_samp", value = "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, double)") +@Description(name = "var_samp", + value = "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, double)") public class VectorUDAFVarSampDouble extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFVarSampDouble(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampLong.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampLong.java index 3340589..b778dc0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampLong.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/gen/VectorUDAFVarSampLong.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * VectorUDAFVarSampLong. Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "var_samp", value = "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, long)") +@Description(name = "var_samp", + value = "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, long)") public class VectorUDAFVarSampLong extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public VectorUDAFVarSampLong(VectorExpression inputExpression) { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleColumn.java index 19cffbd..714a3a0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColAddDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColAddDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleScalar.java index 853a358..05998bb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColAddDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongColumn.java index 5b37d0d..cbe202f 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColAddLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColAddLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongScalar.java index 9ebd33c..a107677 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColAddLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColAddLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleColumn.java index b8d7390..149c4c7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColDivideDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColDivideDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleScalar.java index 88fde1f..8aa4ffa 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColDivideDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongColumn.java index 067f3ba..c1d49c7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColDivideLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColDivideLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongScalar.java index ddb5471..6f1ef71 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColDivideLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColDivideLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColEqualDoubleScalar.java index 6b093c1..5b4f26b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class DoubleColEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterDoubleScalar.java index fe0c641..391e8b9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class DoubleColGreaterDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterEqualDoubleScalar.java index 165582c..ea958b0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColGreaterEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class DoubleColGreaterEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessDoubleScalar.java index 46177ae..e7f123c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class DoubleColLessDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessEqualDoubleScalar.java index 1d5909e..d95c7e2 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColLessEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class DoubleColLessEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleColumn.java index 4d33879..5e8f699 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColModuloDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColModuloDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleScalar.java index 97ca799..25a495a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColModuloDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongColumn.java index 4207eb9..bf187b3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColModuloLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColModuloLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongScalar.java index 4ca1937..af9bbd7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColModuloLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColModuloLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleColumn.java index 3851efd..f6c31d6 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColMultiplyDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColMultiplyDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleScalar.java index 322f9ba..927f7e4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColMultiplyDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongColumn.java index 6029299..691e2d0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColMultiplyLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColMultiplyLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongScalar.java index 5505ac3..b84bdfe 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColMultiplyLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColMultiplyLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColNotEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColNotEqualDoubleScalar.java index 5a4eed5..f99f71e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColNotEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColNotEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class DoubleColNotEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleColumn.java index 5a69799..736653a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColSubtractDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColSubtractDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleScalar.java index 905a9c1..0fd9fd3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColSubtractDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongColumn.java index 2469469..7d91a7e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class DoubleColSubtractLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public DoubleColSubtractLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongScalar.java index e53e7be..413c7ed 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColSubtractLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class DoubleColSubtractLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColUnaryMinus.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColUnaryMinus.java index 9e85323..6dc662c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColUnaryMinus.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleColUnaryMinus.java @@ -22,9 +22,12 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnUnaryMinus.txt, which covers unary negation operator. + */ public class DoubleColUnaryMinus extends VectorExpression { - int colNum; - int outputColumn; + private int colNum; + private int outputColumn; public DoubleColUnaryMinus(int colNum, int outputColumn) { this.colNum = colNum; @@ -64,11 +67,11 @@ public void evaluate(VectorizedRowBatch batch) { if (batch.selectedInUse) { for(int j=0; j != n; j++) { int i = sel[j]; - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } } else { for(int i = 0; i != n; i++) { - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } } outputColVector.isRepeating = false; @@ -76,12 +79,12 @@ public void evaluate(VectorizedRowBatch batch) { if (batch.selectedInUse) { for(int j=0; j != n; j++) { int i = sel[j]; - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; outputIsNull[i] = inputIsNull[i]; - } + } } else { for(int i = 0; i != n; i++) { - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } System.arraycopy(inputIsNull, 0, outputIsNull, 0, n); } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddDoubleColumn.java index 9b7411d..e00a758 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddLongColumn.java index e9caf5f..fbc61b3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarAddLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideDoubleColumn.java index 1564b46..f2c83f6 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideLongColumn.java index 402c9ac..523ac59 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarDivideLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloDoubleColumn.java index 6e122c4..44f9d17 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloLongColumn.java index 5fc4d07..dd7734e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarModuloLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyDoubleColumn.java index 0d7a82f..a76f5ed 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyLongColumn.java index 997e4ec..4272ce5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarMultiplyLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractDoubleColumn.java index 5a7434c..b71f7a7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractLongColumn.java index 7867f51..f468dcb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/DoubleScalarSubtractLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleColumn.java index c4b4c96..21ba954 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleScalar.java index 9b8ce7c..ec7dc3c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongColumn.java index 3a40761..7521db4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongScalar.java index cd1e245..23aee90 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleColumn.java index 020cc2d..d66b769 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColGreaterDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleScalar.java index 9f61e3b..e741ca4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleColumn.java index cd7b052..3fc194a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColGreaterEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleScalar.java index 3b6e1ae..0cc1664 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongColumn.java index de65022..427f88e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColGreaterEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongScalar.java index e8dd693..61dd8f7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongColumn.java index 5e7fcf1..1685a7d 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColGreaterLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongScalar.java index bbe1485..b12ebbd 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColGreaterLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColGreaterLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleColumn.java index 0c06e21..4ddb171 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColLessDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleScalar.java index 4d71105..f4ac9d9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleColumn.java index 958a4c1..59fbd6e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColLessEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleScalar.java index 913ab9b..0681b3c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongColumn.java index deabf10..2e98b95 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColLessEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongScalar.java index 9fd91d6..246abce 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongColumn.java index bd13f7b..7bb6763 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColLessLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongScalar.java index 3477602..d5e1232 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColLessLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColLessLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleColumn.java index 8f3faee..563722b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColNotEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColNotEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleScalar.java index 9601422..b4d1349 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColNotEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongColumn.java index 130723a..1bf4d59 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColNotEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterDoubleColNotEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongScalar.java index 5f6983f..664031b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleColNotEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleColNotEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualDoubleColumn.java index 15a52f4..9032ef4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarEqualDoubleColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualLongColumn.java index a3315fc..7fdc3ac 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarEqualLongColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterDoubleColumn.java index 318fb29..249833c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarGreaterDoubleColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualDoubleColumn.java index 4fb4038..ba052ec 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarGreaterEqualDoubleColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualLongColumn.java index 1a77b4f..72c9bcb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarGreaterEqualLongColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterLongColumn.java index 9046eed..53aec63 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarGreaterLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarGreaterLongColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessDoubleColumn.java index 6642f7a..f73b8a9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarLessDoubleColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualDoubleColumn.java index 36faf7f..7cfd672 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarLessEqualDoubleColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualLongColumn.java index dfe7ead..b1f5fbc 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarLessEqualLongColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessLongColumn.java index 4f07970..7da29b4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarLessLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarLessLongColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualDoubleColumn.java index 0c7d7aa..4d55cb0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarNotEqualDoubleColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualLongColumn.java index 8d50db7..29ff6f7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterDoubleScalarNotEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterDoubleScalarNotEqualLongColumn extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleColumn.java index d06bb0c..9ea140d 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleScalar.java index aae2700..c4f5e55 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongColumn.java index 36a6b92..43980ea 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongScalar.java index cfd0714..a4497d0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleColumn.java index 6c96b96..f3b4b63 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColGreaterDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleScalar.java index d1da68e..32c50f0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleColumn.java index 3b85914..8a3b39c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColGreaterEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleScalar.java index 0f31349..6b121da 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongColumn.java index d6144d2..de8e378 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColGreaterEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongScalar.java index 75e758e..f9e0cda 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongColumn.java index 822e584..bf54aa3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColGreaterLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongScalar.java index 577abe3..1bb6013 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColGreaterLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColGreaterLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleColumn.java index 13555fe..8b034e9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColLessDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleScalar.java index 1005d46..d471408 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleColumn.java index 96afae4..64b34ec 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColLessEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleScalar.java index 57b3c33..5f357d7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongColumn.java index 91609aa..50cad52 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColLessEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongScalar.java index 63116a8..013a572 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongColumn.java index 4f2aec5..99284d3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColLessLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongScalar.java index 55e9e09..23ef3c7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColLessLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColLessLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleColumn.java index acc9d20..c5ea2b7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColNotEqualDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColNotEqualDoubleColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleScalar.java index f6a3fb2..b182e5f 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualDoubleScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColNotEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongColumn.java index b8e71dd..368f931 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongColumn.java @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColNotEqualLongColumn extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public FilterLongColNotEqualLongColumn(int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongScalar.java index c359d5b..8a41884 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongColNotEqualLongScalar.java @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongColNotEqualLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualDoubleColumn.java index 4328719..0f217c0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarEqualDoubleColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualLongColumn.java index c42bfbe..c26f923 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarEqualLongColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterDoubleColumn.java index d00f9fd..b491e1a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarGreaterDoubleColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualDoubleColumn.java index 40558e5..1f0c573 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarGreaterEqualDoubleColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualLongColumn.java index 917511b..91faaf1 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarGreaterEqualLongColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterLongColumn.java index 87222fc..655eb8c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarGreaterLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarGreaterLongColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessDoubleColumn.java index a92ab19..65e741d 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarLessDoubleColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualDoubleColumn.java index a532164..d23b9ae 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarLessEqualDoubleColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualLongColumn.java index c94b4d0..6206503 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarLessEqualLongColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessLongColumn.java index 375d262..c3444c9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarLessLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarLessLongColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualDoubleColumn.java index d5e9205..a1b5776 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualDoubleColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarNotEqualDoubleColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualLongColumn.java index eebcef8..3aeeafd 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/FilterLongScalarNotEqualLongColumn.java @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class FilterLongScalarNotEqualLongColumn extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleColumn.java index 4102544..36ad564 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColAddDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColAddDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleScalar.java index b0b4615..0da2aa0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColAddDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongColumn.java index 6f40032..d258f6c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColAddLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColAddLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongScalar.java index 5b10f39..f5933c5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColAddLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColAddLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleColumn.java index b422a4d..e7b16f8 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColDivideDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColDivideDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleScalar.java index ba539ee..5770136 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColDivideDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColDivideDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColEqualDoubleScalar.java index f391d76..cb654fa 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class LongColEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterDoubleScalar.java index 86c06e6..474bdcb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class LongColGreaterDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterEqualDoubleScalar.java index e5f14ac..197ccfb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColGreaterEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class LongColGreaterEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessDoubleScalar.java index 272a288..a88ee56 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class LongColLessDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessEqualDoubleScalar.java index a6466ac..c54aa14 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColLessEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class LongColLessEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleColumn.java index 119d173..6b832f5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColModuloDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColModuloDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleScalar.java index 879c5c8..c4104c5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColModuloDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongColumn.java index 47f69f4..bee034e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColModuloLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColModuloLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongScalar.java index a571280..bca8b01 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColModuloLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColModuloLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleColumn.java index 8905edf..950aa79 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColMultiplyDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColMultiplyDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleScalar.java index 1d47276..2a13575 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColMultiplyDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongColumn.java index 02e4496..1f9844a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColMultiplyLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColMultiplyLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongScalar.java index ea5ef16..f2884fc 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColMultiplyLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColMultiplyLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColNotEqualDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColNotEqualDoubleScalar.java index 34882e7..30bdb00 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColNotEqualDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColNotEqualDoubleScalar.java @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class LongColNotEqualDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleColumn.java index 277e738..d9a24be 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColSubtractDoubleColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColSubtractDoubleColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleScalar.java index 10aeacc..5bf2f34 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractDoubleScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColSubtractDoubleScalar extends VectorExpression { private int colNum; private double value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongColumn.java index 9013b93..d3219fe 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongColumn.java @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class LongColSubtractLongColumn extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public LongColSubtractLongColumn(int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongScalar.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongScalar.java index 84c0601..02c5894 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongScalar.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColSubtractLongScalar.java @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class LongColSubtractLongScalar extends VectorExpression { private int colNum; private long value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColUnaryMinus.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColUnaryMinus.java index c39c108..8f33a55 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColUnaryMinus.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongColUnaryMinus.java @@ -22,9 +22,12 @@ import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnUnaryMinus.txt, which covers unary negation operator. + */ public class LongColUnaryMinus extends VectorExpression { - int colNum; - int outputColumn; + private int colNum; + private int outputColumn; public LongColUnaryMinus(int colNum, int outputColumn) { this.colNum = colNum; @@ -64,11 +67,11 @@ public void evaluate(VectorizedRowBatch batch) { if (batch.selectedInUse) { for(int j=0; j != n; j++) { int i = sel[j]; - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } } else { for(int i = 0; i != n; i++) { - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } } outputColVector.isRepeating = false; @@ -76,12 +79,12 @@ public void evaluate(VectorizedRowBatch batch) { if (batch.selectedInUse) { for(int j=0; j != n; j++) { int i = sel[j]; - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; outputIsNull[i] = inputIsNull[i]; - } + } } else { for(int i = 0; i != n; i++) { - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } System.arraycopy(inputIsNull, 0, outputIsNull, 0, n); } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddDoubleColumn.java index 9dafc7a..97dc672 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddLongColumn.java index 1e795a9..4d90f2b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarAddLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarDivideDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarDivideDoubleColumn.java index 4147185..e5ed537 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarDivideDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarDivideDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloDoubleColumn.java index 4c25195..0ddb280 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloLongColumn.java index 7729d70..edf2220 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarModuloLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyDoubleColumn.java index fd4a825..5fc259a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyLongColumn.java index ca1e1ad..e7e8903 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarMultiplyLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractDoubleColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractDoubleColumn.java index 71cd1dd..14096f6 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractDoubleColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractDoubleColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractLongColumn.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractLongColumn.java index 53b68f7..a6cde10 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractLongColumn.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/LongScalarSubtractLongColumn.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/CodeGen.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/CodeGen.java index bee2a63..a4c1999 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/CodeGen.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/CodeGen.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.hadoop.hive.ql.exec.vector.expressions.templates; import java.io.BufferedReader; @@ -7,9 +25,12 @@ import java.io.FileWriter; import java.io.IOException; +/** + * This class generates java classes from the templates. + */ public class CodeGen { - static String [][] templateExpansions = + private static String [][] templateExpansions = { {"ColumnArithmeticScalar", "Add", "long", "long", "+"}, {"ColumnArithmeticScalar", "Subtract", "long", "long", "-"}, @@ -195,14 +216,20 @@ {"ColumnUnaryMinus", "long"}, {"ColumnUnaryMinus", "double"}, - //template, , , , , - {"VectorUDAFMinMax", "VectorUDAFMinLong", "long", "<", "min", "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: long)"}, - {"VectorUDAFMinMax", "VectorUDAFMinDouble", "double", "<", "min", "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: double)"}, - {"VectorUDAFMinMax", "VectorUDAFMaxLong", "long", ">", "max", "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: long)"}, - {"VectorUDAFMinMax", "VectorUDAFMaxDouble", "double", ">", "max", "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: double)"}, - - {"VectorUDAFMinMaxString", "VectorUDAFMinString", "<", "min", "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)"}, - {"VectorUDAFMinMaxString", "VectorUDAFMaxString", ">", "max", "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)"}, + // template, , , , , + {"VectorUDAFMinMax", "VectorUDAFMinLong", "long", "<", "min", + "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: long)"}, + {"VectorUDAFMinMax", "VectorUDAFMinDouble", "double", "<", "min", + "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: double)"}, + {"VectorUDAFMinMax", "VectorUDAFMaxLong", "long", ">", "max", + "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: long)"}, + {"VectorUDAFMinMax", "VectorUDAFMaxDouble", "double", ">", "max", + "_FUNC_(expr) - Returns the maximum value of expr (vectorized, type: double)"}, + + {"VectorUDAFMinMaxString", "VectorUDAFMinString", "<", "min", + "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)"}, + {"VectorUDAFMinMaxString", "VectorUDAFMaxString", ">", "max", + "_FUNC_(expr) - Returns the minimum value of expr (vectorized, type: string)"}, //template, , {"VectorUDAFSum", "VectorUDAFSumLong", "long"}, @@ -210,15 +237,32 @@ {"VectorUDAFAvg", "VectorUDAFAvgLong", "long"}, {"VectorUDAFAvg", "VectorUDAFAvgDouble", "double"}, - //template, , , , , - {"VectorUDAFVar", "VectorUDAFVarPopLong", "long", "myagg.variance / myagg.count", "variance, var_pop", "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, long)"}, - {"VectorUDAFVar", "VectorUDAFVarPopDouble", "double", "myagg.variance / myagg.count", "variance, var_pop", "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, double)"}, - {"VectorUDAFVar", "VectorUDAFVarSampLong", "long", "myagg.variance / (myagg.count-1.0)", "var_samp", "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, long)"}, - {"VectorUDAFVar", "VectorUDAFVarSampDouble", "double", "myagg.variance / (myagg.count-1.0)", "var_samp", "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, double)"}, - {"VectorUDAFVar", "VectorUDAFStdPopLong", "long", "Math.sqrt(myagg.variance / (myagg.count))", "std,stddev,stddev_pop", "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, long)"}, - {"VectorUDAFVar", "VectorUDAFStdPopDouble", "double", "Math.sqrt(myagg.variance / (myagg.count))", "std,stddev,stddev_pop", "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, double)"}, - {"VectorUDAFVar", "VectorUDAFStdSampLong", "long", "Math.sqrt(myagg.variance / (myagg.count-1.0))", "stddev_samp", "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, long)"}, - {"VectorUDAFVar", "VectorUDAFStdSampDouble", "double", "Math.sqrt(myagg.variance / (myagg.count-1.0))", "stddev_samp", "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, double)"}, + // template, , , , , + // + {"VectorUDAFVar", "VectorUDAFVarPopLong", "long", "myagg.variance / myagg.count", + "variance, var_pop", + "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, long)"}, + {"VectorUDAFVar", "VectorUDAFVarPopDouble", "double", "myagg.variance / myagg.count", + "variance, var_pop", + "_FUNC_(x) - Returns the variance of a set of numbers (vectorized, double)"}, + {"VectorUDAFVar", "VectorUDAFVarSampLong", "long", "myagg.variance / (myagg.count-1.0)", + "var_samp", + "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, long)"}, + {"VectorUDAFVar", "VectorUDAFVarSampDouble", "double", "myagg.variance / (myagg.count-1.0)", + "var_samp", + "_FUNC_(x) - Returns the sample variance of a set of numbers (vectorized, double)"}, + {"VectorUDAFVar", "VectorUDAFStdPopLong", "long", + "Math.sqrt(myagg.variance / (myagg.count))", "std,stddev,stddev_pop", + "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, long)"}, + {"VectorUDAFVar", "VectorUDAFStdPopDouble", "double", + "Math.sqrt(myagg.variance / (myagg.count))", "std,stddev,stddev_pop", + "_FUNC_(x) - Returns the standard deviation of a set of numbers (vectorized, double)"}, + {"VectorUDAFVar", "VectorUDAFStdSampLong", "long", + "Math.sqrt(myagg.variance / (myagg.count-1.0))", "stddev_samp", + "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, long)"}, + {"VectorUDAFVar", "VectorUDAFStdSampDouble", "double", + "Math.sqrt(myagg.variance / (myagg.count-1.0))", "stddev_samp", + "_FUNC_(x) - Returns the sample standard deviation of a set of numbers (vectorized, double)"}, }; @@ -239,13 +283,13 @@ public CodeGen() { templateDirectory = System.getProperty("user.dir"); File f = new File(templateDirectory); outputDirectory = joinPath(f.getParent(), "gen"); - testCodeGen = new TestCodeGen(joinPath(f.getParent(), "test"),templateDirectory); + testCodeGen = new TestCodeGen(joinPath(f.getParent(), "test"), templateDirectory); } public CodeGen(String templateDirectory, String outputDirectory, String testOutputDirectory) { this.templateDirectory = templateDirectory; this.outputDirectory = outputDirectory; - testCodeGen = new TestCodeGen(testOutputDirectory,templateDirectory); + testCodeGen = new TestCodeGen(testOutputDirectory, templateDirectory); } /** @@ -418,16 +462,17 @@ private void generateFilterStringScalarCompareColumn(String[] tdesc) throws IOEx private void generateFilterStringColumnCompareScalar(String[] tdesc) throws IOException { String operatorName = tdesc[1]; String className = "FilterStringCol" + operatorName + "StringScalar"; - generateFilterStringColumnCompareScalar(tdesc,className); + generateFilterStringColumnCompareScalar(tdesc, className); } private void generateFilterStringColumnCompareColumn(String[] tdesc) throws IOException { String operatorName = tdesc[1]; String className = "FilterStringCol" + operatorName + "StringColumn"; - generateFilterStringColumnCompareScalar(tdesc,className); + generateFilterStringColumnCompareScalar(tdesc, className); } - private void generateFilterStringColumnCompareScalar(String[] tdesc, String className) throws IOException { + private void generateFilterStringColumnCompareScalar(String[] tdesc, String className) + throws IOException { String operatorSymbol = tdesc[2]; String outputFile = joinPath(this.outputDirectory, className + ".java"); // Read the template into a string; @@ -569,16 +614,14 @@ private void generateColumnBinaryOperatorScalar(String[] tdesc, String returnTyp templateString = templateString.replaceAll("", returnType); writeFile(outputFile, templateString); - if(returnType==null) - { + if(returnType==null) { testCodeGen.addColumnScalarFilterTestCases( true, className, inputColumnVectorType, operandType2, operatorSymbol); - }else - { + } else { testCodeGen.addColumnScalarOperationTestCases( true, className, @@ -586,7 +629,6 @@ private void generateColumnBinaryOperatorScalar(String[] tdesc, String returnTyp outputColumnVectorType, operandType2); } - } private void generateScalarBinaryOperatorColumn(String[] tdesc, String returnType, @@ -610,16 +652,14 @@ private void generateScalarBinaryOperatorColumn(String[] tdesc, String returnTyp templateString = templateString.replaceAll("", returnType); writeFile(outputFile, templateString); - if(returnType==null) - { + if(returnType==null) { testCodeGen.addColumnScalarFilterTestCases( false, className, inputColumnVectorType, operandType1, operatorSymbol); - }else - { + } else { testCodeGen.addColumnScalarOperationTestCases( false, className, diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticColumn.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticColumn.txt index 210498c..dcd11d0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticColumn.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticColumn.txt @@ -23,10 +23,14 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnArithmeticColumn.txt, which covers binary arithmetic + * expressions between columns. + */ public class extends VectorExpression { - int colNum1; - int colNum2; - int outputColumn; + private int colNum1; + private int colNum2; + private int outputColumn; public (int colNum1, int colNum2, int outputColumn) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticScalar.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticScalar.txt index 15fdbad..33241d5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticScalar.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticScalar.txt @@ -24,6 +24,10 @@ import org.apache.hadoop.hive.ql.exec.vector.; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; +/** + * Generated from template ColumnArithmeticScalar.txt, which covers binary arithmetic + * expressions between a column and a scalar. + */ public class extends VectorExpression { private int colNum; private value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnCompareScalar.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnCompareScalar.txt index be42f6a..6a687c2 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnCompareScalar.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnCompareScalar.txt @@ -23,6 +23,11 @@ import org.apache.hadoop.hive.ql.exec.vector.; import org.apache.hadoop.hive.ql.exec.vector.; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar. The boolean output is stored in a + * separate boolean column. + */ public class extends VectorExpression { private int colNum; private value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnUnaryMinus.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnUnaryMinus.txt index 9d16bdd..4b4e647 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnUnaryMinus.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnUnaryMinus.txt @@ -22,9 +22,12 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template ColumnUnaryMinus.txt, which covers unary negation operator. + */ public class extends VectorExpression { - int colNum; - int outputColumn; + private int colNum; + private int outputColumn; public (int colNum, int outputColumn) { this.colNum = colNum; @@ -64,11 +67,11 @@ public class extends VectorExpression { if (batch.selectedInUse) { for(int j=0; j != n; j++) { int i = sel[j]; - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } } else { for(int i = 0; i != n; i++) { - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } } outputColVector.isRepeating = false; @@ -76,12 +79,12 @@ public class extends VectorExpression { if (batch.selectedInUse) { for(int j=0; j != n; j++) { int i = sel[j]; - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; outputIsNull[i] = inputIsNull[i]; - } + } } else { for(int i = 0; i != n; i++) { - outputVector[i] = - vector[i]; + outputVector[i] = -vector[i]; } System.arraycopy(inputIsNull, 0, outputIsNull, 0, n); } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareColumn.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareColumn.txt index 8e3b717..ab0d612 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareColumn.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareColumn.txt @@ -22,9 +22,14 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.*; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterColumnCompareColumn.txt, which covers binary comparison + * expressions between two columns, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class extends VectorExpression { - int colNum1; - int colNum2; + private int colNum1; + private int colNum2; public (int colNum1, int colNum2) { this.colNum1 = colNum1; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareScalar.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareScalar.txt index 04bc69c..b8758c5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareScalar.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareScalar.txt @@ -22,7 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - +/** + * Generated from template FilterColumnCompareScalar.txt, which covers binary comparison + * expressions between a column and a scalar, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class extends VectorExpression { private int colNum; private value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterScalarCompareColumn.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterScalarCompareColumn.txt index 83c91e1..69eb575 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterScalarCompareColumn.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterScalarCompareColumn.txt @@ -22,6 +22,11 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +/** + * Generated from template FilterScalarCompareColumn.txt, which covers binary comparison + * expressions between a scalar and a column, however output is not produced in a separate column. + * The selected vector of the input {@link VectorizedRowBatch} is updated for in-place filtering. + */ public class extends VectorExpression { private int colNum; private value; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt index 0f82f5b..14f56d0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil; /** + * Generated from template ScalarArithmeticColumn.txt. * Implements a vectorized arithmetic operator with a scalar on the left and a * column vector on the right. The result is output to an output column vector. */ diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt index c5a8a57..48022f4 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,25 +35,21 @@ import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; -import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; -import org.apache.hadoop.hive.ql.io.orc.*; - -@Description(name = "avg", value = "_FUNC_(expr) - Returns the average value of expr (vectorized, type: )") +/** + * Generated from template VectorUDAFAvg.txt. + */ +@Description(name = "avg", + value = "_FUNC_(expr) - Returns the average value of expr (vectorized, type: )") public class extends VectorAggregateExpression { /** class for storing the current aggregate value. */ static class Aggregation implements AggregationBuffer { - double sum; - long count; - boolean isNull; + private double sum; + private long count; + private boolean isNull; public void sumValue( value) { if (isNull) { @@ -91,10 +87,10 @@ public class extends VectorAggregateExpression { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); soi = ObjectInspectorFactory.getStandardStructObjectInspector(fname, foi); @@ -291,11 +287,13 @@ public class extends VectorAggregateExpression { @Override - public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException { + public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) + throws HiveException { inputExpression.evaluate(batch); - inputVector = ()batch.cols[this.inputExpression.getOutputColumn()]; + inputVector = + ()batch.cols[this.inputExpression.getOutputColumn()]; int batchSize = batch.size; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt index b955236..9a0afa1 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt @@ -18,13 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates. - VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriter; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriterFactory; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; @@ -34,30 +30,21 @@ import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.ql.util.JavaDataModel; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * . Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "", value = "") +@Description(name = "", + value = "") public class extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - value; - boolean isNull; + private value; + private boolean isNull; public void checkValue( value) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt index a066e15..7978fdf 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt @@ -24,7 +24,6 @@ import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.StringExpr; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector; @@ -32,30 +31,25 @@ import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.ql.util.JavaDataModel; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.BinaryObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; import org.apache.hadoop.io.Text; /** * . Vectorized implementation for MIN/MAX aggregates. */ -@Description(name = "", value = "") +@Description(name = "", + value = "") public class extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ static private final class Aggregation implements AggregationBuffer { - final static int MIN_BUFFER_SIZE = 16; - byte[] bytes = new byte[MIN_BUFFER_SIZE]; - int length; - boolean isNull; + private final static int MIN_BUFFER_SIZE = 16; + private byte[] bytes = new byte[MIN_BUFFER_SIZE]; + private int length; + private boolean isNull; public void checkValue(byte[] bytes, int start, int length) { if (isNull) { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt index 3ff647b..b4d55bd 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt @@ -18,12 +18,9 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; -import java.util.ArrayList; - import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -34,27 +31,21 @@ import org.apache.hadoop.hive.ql.util.JavaDataModel; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * . Vectorized implementation for SUM aggregates. */ -@Description(name = "sum", value = "_FUNC_(expr) - Returns the sum value of expr (vectorized, type: )") +@Description(name = "sum", + value = "_FUNC_(expr) - Returns the sum value of expr (vectorized, type: )") public class extends VectorAggregateExpression { /** - /* class for storing the current aggregate value. - */ + * class for storing the current aggregate value. + */ private static final class Aggregation implements AggregationBuffer { - sum; - boolean isNull; + private sum; + private boolean isNull; public void sumValue( value) { if (isNull) { @@ -71,8 +62,8 @@ public class extends VectorAggregateExpression { } } - VectorExpression inputExpression; - private result; + private final VectorExpression inputExpression; + private final result; public (VectorExpression inputExpression) { super(); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt index 2ad7e04..1b5b8ee 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt @@ -19,11 +19,11 @@ package org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen; import java.util.ArrayList; +import java.util.List; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression; -import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.VectorAggregateExpression.AggregationBuffer; import org.apache.hadoop.hive.ql.exec.vector.VectorAggregationBufferRow; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; @@ -35,28 +35,23 @@ import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; /** * . Vectorized implementation for VARIANCE aggregates. */ -@Description(name = "", value = "") +@Description(name = "", + value = "") public class extends VectorAggregateExpression { /** /* class for storing the current aggregate value. */ private static final class Aggregation implements AggregationBuffer { - double sum; - long count; - double variance; - boolean isNull; + private double sum; + private long count; + private double variance; + private boolean isNull; public void init() { isNull = false; @@ -94,12 +89,12 @@ public class extends VectorAggregateExpression { } private void initPartialResultInspector() { - ArrayList foi = new ArrayList(); + List foi = new ArrayList(); foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector); - ArrayList fname = new ArrayList(); + List fname = new ArrayList(); fname.add("count"); fname.add("sum"); fname.add("variance"); diff --git ql/src/java/org/apache/hadoop/hive/ql/udf/IUDFUnaryString.java ql/src/java/org/apache/hadoop/hive/ql/udf/IUDFUnaryString.java index 017a89e..360843d 100644 --- ql/src/java/org/apache/hadoop/hive/ql/udf/IUDFUnaryString.java +++ ql/src/java/org/apache/hadoop/hive/ql/udf/IUDFUnaryString.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.hadoop.hive.ql.udf; import org.apache.hadoop.io.Text; diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java index 57ecb68..8881e0f 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorFilterOperator.java @@ -24,23 +24,24 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression; import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColEqualDoubleScalar; import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterLongColumn; -import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.FilterLongColGreaterLongScalar; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.junit.Test; +/** + * Test cases for vectorized filter operator. + */ public class TestVectorFilterOperator { - - /* + + /** * Fundamental logic and performance tests for vector filters belong here. - * + * * For tests about filters to cover specific operator and data type combinations, * see also the other filter tests under org.apache.hadoop.hive.ql.exec.vector.expressions */ - public static class FakeDataReader { - int size; - VectorizedRowBatch vrg; - int currentSize = 0; + private final int size; + private final VectorizedRowBatch vrg; + private int currentSize = 0; private final int numCols; private final int len = 1024; @@ -51,9 +52,7 @@ public FakeDataReader(int size, int numCols) { for (int i = 0; i < numCols; i++) { try { Thread.sleep(2); - } catch (InterruptedException e) { - - } + } catch (InterruptedException ignore) {} vrg.cols[i] = getLongVector(len); } } diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorGroupByOperator.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorGroupByOperator.java index 65657ea..d1d2ea9 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorGroupByOperator.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorGroupByOperator.java @@ -1665,7 +1665,8 @@ public void testAggregateLongKeyAggregate ( HashMap expected) throws HiveException { @SuppressWarnings("unchecked") - FakeVectorRowBatchFromLongIterables fdr = new FakeVectorRowBatchFromLongIterables(batchSize, list, values); + FakeVectorRowBatchFromLongIterables fdr = new FakeVectorRowBatchFromLongIterables(batchSize, + list, values); testAggregateLongKeyIterable (aggregateName, fdr, expected); } @@ -1701,7 +1702,8 @@ public void testAggregateLongAggregate ( Object expected) throws HiveException { @SuppressWarnings("unchecked") - FakeVectorRowBatchFromLongIterables fdr = new FakeVectorRowBatchFromLongIterables(batchSize, values); + FakeVectorRowBatchFromLongIterables fdr = new FakeVectorRowBatchFromLongIterables(batchSize, + values); testAggregateLongIterable (aggregateName, fdr, expected); } @@ -1711,7 +1713,8 @@ public void testAggregateCountStar ( Object expected) throws HiveException { @SuppressWarnings("unchecked") - FakeVectorRowBatchFromLongIterables fdr = new FakeVectorRowBatchFromLongIterables(batchSize, values); + FakeVectorRowBatchFromLongIterables fdr = new FakeVectorRowBatchFromLongIterables(batchSize, + values); testAggregateCountStarIterable (fdr, expected); } @@ -1904,7 +1907,8 @@ public void testAggregateStringIterable ( mapColumnNames.put("A", 0); VectorizationContext ctx = new VectorizationContext(mapColumnNames, 1); - GroupByDesc desc = buildGroupByDescType (ctx, aggregateName, "A", TypeInfoFactory.stringTypeInfo); + GroupByDesc desc = buildGroupByDescType(ctx, aggregateName, "A", + TypeInfoFactory.stringTypeInfo); VectorGroupByOperator vgo = new VectorGroupByOperator(ctx, desc); @@ -1934,7 +1938,8 @@ public void testAggregateDoubleIterable ( mapColumnNames.put("A", 0); VectorizationContext ctx = new VectorizationContext(mapColumnNames, 1); - GroupByDesc desc = buildGroupByDescType (ctx, aggregateName, "A", TypeInfoFactory.doubleTypeInfo); + GroupByDesc desc = buildGroupByDescType (ctx, aggregateName, "A", + TypeInfoFactory.doubleTypeInfo); VectorGroupByOperator vgo = new VectorGroupByOperator(ctx, desc); diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java index dd2f839..cd9e836 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java @@ -39,6 +39,9 @@ import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; import org.junit.Test; +/** + * Unit tests for vectorized select operator. + */ public class TestVectorSelectOperator { static class ValidatorVectorSelectOperator extends VectorSelectOperator { diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java index 7de0113..189799e 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.hadoop.hive.ql.exec.vector; import static org.junit.Assert.assertEquals; diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java index 9a56c52..efbc758 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java @@ -59,7 +59,7 @@ import org.junit.Test; /** - * Class that tests the functionality of VectorizedRowBatchCtx + * Class that tests the functionality of VectorizedRowBatchCtx. */ public class TestVectorizedRowBatchCtx { @@ -81,7 +81,7 @@ public void openFileSystem() throws Exception { fs.delete(testFilePath, false); } - private void InitSerde() { + private void initSerde() { tbl = new Properties(); // Set the configuration parameters @@ -325,8 +325,7 @@ void ValidateRowBatch(VectorizedRowBatch batch) throws IOException, SerDeExcepti @Test public void TestCtx() throws Exception { - - InitSerde(); + initSerde(); WriteRCFile(this.fs, this.testFilePath, this.conf); VectorizedRowBatch batch = GetRowBatch(); ValidateRowBatch(batch); diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestConstantVectorExpression.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestConstantVectorExpression.java index c656ce4..4321545 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestConstantVectorExpression.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestConstantVectorExpression.java @@ -30,6 +30,9 @@ import org.apache.hadoop.hive.ql.exec.vector.util.VectorizedRowGroupGenUtil; import org.junit.Test; +/** + * Test vector expressions with constants. + */ public class TestConstantVectorExpression { @Test diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java index 0cf3bf8..289a508 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java @@ -26,12 +26,15 @@ import org.apache.hadoop.hive.ql.exec.vector.util.VectorizedRowGroupGenUtil; import org.junit.Test; +/** + * Unit tests for unary minus. + */ public class TestUnaryMinus { @Test public void testUnaryMinus() { VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(1024, 2, 23); - LongColUnaryMinus expr = new LongColUnaryMinus(0,1); + LongColUnaryMinus expr = new LongColUnaryMinus(0, 1); expr.evaluate(vrg); //verify long[] inVector = ((LongColumnVector) vrg.cols[0]).vector; diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java index a5aadac..9de8461 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java @@ -23,22 +23,23 @@ import static org.junit.Assert.assertTrue; import junit.framework.Assert; -import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; +import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.TestVectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColAddLongColumn; import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColAddLongScalar; -import org.apache.hadoop.hive.ql.exec.vector.expressions.LongColDivideLongColumn; import org.apache.hadoop.hive.ql.exec.vector.util.VectorizedRowGroupGenUtil; import org.junit.Test; +/** + * Unit tests for vectori arithmetic expressions. + */ public class TestVectorArithmeticExpressions { @Test public void testLongColAddLongScalarNoNulls() { - VectorizedRowBatch vrg = getVectorizedRowBatchSingleLongVector - (VectorizedRowBatch.DEFAULT_SIZE); + VectorizedRowBatch vrg = getVectorizedRowBatchSingleLongVector(VectorizedRowBatch.DEFAULT_SIZE); LongColAddLongScalar expr = new LongColAddLongScalar(0, 23, 1); expr.evaluate(vrg); //verify @@ -60,7 +61,7 @@ private VectorizedRowBatch getVectorizedRowBatchSingleLongVector(int size) { vrg.size = size; return vrg; } - + public static VectorizedRowBatch getVectorizedRowBatch2LongInDoubleOut() { VectorizedRowBatch batch = new VectorizedRowBatch(3); LongColumnVector lcv, lcv2; @@ -73,7 +74,7 @@ public static VectorizedRowBatch getVectorizedRowBatch2LongInDoubleOut() { batch.cols[1] = lcv2; for (int i = 0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) { lcv2.vector[i] = i * 37; - } + } batch.cols[2] = new DoubleColumnVector(); batch.size = VectorizedRowBatch.DEFAULT_SIZE; return batch; @@ -81,14 +82,14 @@ public static VectorizedRowBatch getVectorizedRowBatch2LongInDoubleOut() { @Test public void testLongColAddLongScalarWithNulls() { - VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector - (VectorizedRowBatch.DEFAULT_SIZE); + VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector( + VectorizedRowBatch.DEFAULT_SIZE); LongColumnVector lcv = (LongColumnVector) batch.cols[0]; LongColumnVector lcvOut = (LongColumnVector) batch.cols[1]; TestVectorizedRowBatch.addRandomNulls(lcv); LongColAddLongScalar expr = new LongColAddLongScalar(0, 23, 1); expr.evaluate(batch); - + // verify for (int i=0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) { if (!lcv.isNull[i]) { @@ -109,8 +110,7 @@ public void testLongColAddLongScalarWithRepeating() { LongColAddLongScalar expr; // Case 1: is repeating, no nulls - batch = getVectorizedRowBatchSingleLongVector - (VectorizedRowBatch.DEFAULT_SIZE); + batch = getVectorizedRowBatchSingleLongVector(VectorizedRowBatch.DEFAULT_SIZE); in = (LongColumnVector) batch.cols[0]; in.isRepeating = true; out = (LongColumnVector) batch.cols[1]; @@ -123,8 +123,7 @@ public void testLongColAddLongScalarWithRepeating() { Assert.assertEquals(out.vector[0], 0 * 37 + 23); // Case 2: is repeating, has nulls - batch = getVectorizedRowBatchSingleLongVector - (VectorizedRowBatch.DEFAULT_SIZE); + batch = getVectorizedRowBatchSingleLongVector(VectorizedRowBatch.DEFAULT_SIZE); in = (LongColumnVector) batch.cols[0]; in.isRepeating = true; in.noNulls = false; @@ -142,9 +141,9 @@ public void testLongColAddLongScalarWithRepeating() { Assert.assertEquals(true, out.isNull[0]); verifyLongNullDataVectorEntries(out, batch.selected, batch.selectedInUse, batch.size); } - - /* Make sure all the NULL entries in this long column output vector have their data vector - * element set to the correct value, as per the specification, to prevent later arithmetic + + /* Make sure all the NULL entries in this long column output vector have their data vector + * element set to the correct value, as per the specification, to prevent later arithmetic * errors (e.g. zero-divide). */ public static void verifyLongNullDataVectorEntries( @@ -155,8 +154,7 @@ public static void verifyLongNullDataVectorEntries( if (v.isNull[0]) { assertEquals(LongColumnVector.NULL_VALUE, v.vector[0]); } - } - else if (selectedInUse) { + } else if (selectedInUse) { for (int j = 0; j != n; j++) { int i = sel[j]; if (v.isNull[i]) { @@ -167,7 +165,7 @@ else if (selectedInUse) { for (int i = 0; i != n; i++) { if (v.isNull[i]) { assertEquals(LongColumnVector.NULL_VALUE, v.vector[i]); - } + } } } } @@ -217,7 +215,7 @@ public void testLongColAddLongColumn() { LongColAddLongColumn expr2 = new LongColAddLongColumn(3, 4, 5); expr2.evaluate(vrg); for (int i = 0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) { - assertEquals(seed * ( 4 + 5*(i+1)), lcv5.vector[i]); + assertEquals(seed * (4 + 5*(i+1)), lcv5.vector[i]); } // Repeating with other as nullable @@ -237,48 +235,48 @@ public void testLongColAddLongColumn() { assertTrue(lcv5.isRepeating); assertTrue(lcv5.isNull[0]); verifyLongNullDataVectorEntries(lcv5, vrg.selected, vrg.selectedInUse, vrg.size); - + // Neither input has nulls. Verify that this propagates to output. vrg.selectedInUse = false; lcv0.noNulls = true; lcv1.noNulls = true; lcv0.isRepeating = false; - lcv1.isRepeating = false; + lcv1.isRepeating = false; lcv2.noNulls = false; // set output noNulls to true to make sure it gets over-written lcv2.isRepeating = true; // similarly with isRepeating expr.evaluate(vrg); assertTrue(lcv2.noNulls); assertFalse(lcv2.isRepeating); } - + @Test public void testLongColDivideLongColumn() { - + /* Testing for equality of doubles after a math operation is * not always reliable so use this as a tolerance. */ - final double eps = 1e-7d; + final double eps = 1e-7d; VectorizedRowBatch batch = getVectorizedRowBatch2LongInDoubleOut(); LongColDivideLongColumn expr = new LongColDivideLongColumn(0, 1, 2); batch.cols[0].isNull[1] = true; batch.cols[0].noNulls = false; batch.cols[1].noNulls = false; DoubleColumnVector out = (DoubleColumnVector) batch.cols[2]; - + // Set so we can verify they are reset by operation out.noNulls = true; out.isRepeating = true; - + expr.evaluate(batch); - + // 0/0 for entry 0 should work but generate NaN assertTrue(Double.isNaN(out.vector[0])); - + // verify NULL output in entry 1 is correct assertTrue(out.isNull[1]); assertTrue(Double.isNaN(out.vector[1])); - // check entries beyond first 2 + // check entries beyond first 2 for (int i = 2; i != batch.size; i++) { assertTrue(out.vector[i] > 1.0d - eps && out.vector[i] < 1.0d + eps); } diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorExpressionWriters.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorExpressionWriters.java index 12a9e2e..1899c3b 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorExpressionWriters.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorExpressionWriters.java @@ -46,6 +46,9 @@ import org.apache.hadoop.io.Writable; import org.junit.Test; +/** + * Unit tests for vector expression writers. + */ public class TestVectorExpressionWriters { private final int vectorSize = 5; diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java index f15bdc0..8321772 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java @@ -35,6 +35,9 @@ import org.junit.Assert; import org.junit.Test; +/** + * Unit tests for filter expressions. + */ public class TestVectorFilterExpressions { @Test @@ -76,8 +79,7 @@ public void testFilterLongColEqualLongColumn() { } @Test - public void testColOpScalarNumericFilterNullAndRepeatingLogic() - { + public void testColOpScalarNumericFilterNullAndRepeatingLogic() { // No nulls, not repeating FilterLongColGreaterLongScalar f = new FilterLongColGreaterLongScalar(0, 1); VectorizedRowBatch batch = this.getSimpleLongBatch(); diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java index 2426588..d7b5410 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java @@ -116,7 +116,7 @@ private VectorizedRowBatch getBatchThreeBooleanCols() { i = 5; v0.vector[i] = 0; v0.isNull[i] = true; v1.vector[i] = 1; v1.isNull[i] = false; // NULL 1 i = 6; v0.vector[i] = 0; v0.isNull[i] = false; v1.vector[i] = 0; v1.isNull[i] = true; // 0 NULL i = 7; v0.vector[i] = 1; v0.isNull[i] = false; v1.vector[i] = 1; v1.isNull[i] = true; // 1 NULL - i = 8; v0.vector[i] = 1; v0.isNull[i] = true; v1.vector[i] = 1; v1.isNull[i] = true; // NULL NULL + i = 8; v0.vector[i] = 1; v0.isNull[i] = true; v1.vector[i] = 1; v1.isNull[i] = true; // NULL NULL v0.noNulls = false; v1.noNulls = false; diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java index 676199d..fa4da40 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java @@ -22,14 +22,12 @@ import static org.junit.Assert.assertTrue; import junit.framework.Assert; -import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarSubtractLongColumn; -import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarModuloLongColumn; -import org.apache.hadoop.hive.ql.exec.vector.expressions.LongColDivideLongScalar; -import org.apache.hadoop.hive.ql.exec.vector.expressions.LongScalarDivideLongColumn; import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector; import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.TestVectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarModuloLongColumn; +import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongScalarSubtractLongColumn; import org.junit.Test; /** @@ -37,12 +35,12 @@ * the left and a column vector on the right. */ public class TestVectorScalarColArithmetic { - + /* Testing for equality of doubles after a math operation is * not always reliable so use this as a tolerance. */ - private final static double eps = 1e-7d; - + private final double EPS = 1e-7d; + private VectorizedRowBatch getVectorizedRowBatchSingleLongVector(int size) { VectorizedRowBatch batch = new VectorizedRowBatch(2, size); LongColumnVector lcv = new LongColumnVector(size); @@ -67,13 +65,13 @@ private VectorizedRowBatch getBatchSingleLongVectorPositiveNonZero() { batch.size = size; return batch; } - + @Test public void testLongScalarModuloLongColNoNulls() { VectorizedRowBatch batch = getBatchSingleLongVectorPositiveNonZero(); LongScalarModuloLongColumn expr = new LongScalarModuloLongColumn(100, 0, 1); expr.evaluate(batch); - + // verify for (int i = 0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) { Assert.assertEquals(100 % ((i + 1) * 37), ((LongColumnVector) batch.cols[1]).vector[i]); @@ -81,14 +79,14 @@ public void testLongScalarModuloLongColNoNulls() { Assert.assertTrue(((LongColumnVector)batch.cols[1]).noNulls); Assert.assertFalse(((LongColumnVector)batch.cols[1]).isRepeating); } - + @Test public void testLongScalarSubtractLongColNoNulls() { VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector( VectorizedRowBatch.DEFAULT_SIZE); LongScalarSubtractLongColumn expr = new LongScalarSubtractLongColumn(100, 0, 1); expr.evaluate(batch); - + //verify for (int i = 0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) { Assert.assertEquals(100 - i * 37, ((LongColumnVector) batch.cols[1]).vector[i]); @@ -105,7 +103,7 @@ public void testLongScalarSubtractLongColWithNulls() { TestVectorizedRowBatch.addRandomNulls(lcv); LongScalarSubtractLongColumn expr = new LongScalarSubtractLongColumn(100, 0, 1); expr.evaluate(batch); - + //verify for (int i=0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) { if (!lcv.isNull[i]) { @@ -117,7 +115,7 @@ public void testLongScalarSubtractLongColWithNulls() { Assert.assertFalse(((LongColumnVector)batch.cols[1]).noNulls); Assert.assertFalse(((LongColumnVector)batch.cols[1]).isRepeating); TestVectorArithmeticExpressions.verifyLongNullDataVectorEntries( - (LongColumnVector) batch.cols[1], batch.selected, batch.selectedInUse, batch.size); + (LongColumnVector) batch.cols[1], batch.selected, batch.selectedInUse, batch.size); } @Test @@ -135,7 +133,7 @@ public void testLongScalarSubtractLongColWithRepeating() { out.isRepeating = false; expr = new LongScalarSubtractLongColumn(100, 0, 1); expr.evaluate(batch); - + // verify Assert.assertTrue(out.isRepeating); Assert.assertTrue(out.noNulls); @@ -155,46 +153,46 @@ public void testLongScalarSubtractLongColWithRepeating() { out.noNulls = true; expr = new LongScalarSubtractLongColumn(100, 0, 1); expr.evaluate(batch); - + // verify Assert.assertTrue(out.isRepeating); Assert.assertFalse(out.noNulls); Assert.assertEquals(true, out.isNull[0]); TestVectorArithmeticExpressions.verifyLongNullDataVectorEntries( - out, batch.selected, batch.selectedInUse, batch.size); + out, batch.selected, batch.selectedInUse, batch.size); } - - private static boolean equalsWithinTolerance(double a, double b) { - return Math.abs(a - b) < eps; + + private boolean equalsWithinTolerance(double a, double b) { + return Math.abs(a - b) < EPS; } - + @Test public void testLongScalarDivide() { - VectorizedRowBatch batch = + VectorizedRowBatch batch = TestVectorArithmeticExpressions.getVectorizedRowBatch2LongInDoubleOut(); LongColDivideLongScalar expr = new LongColDivideLongScalar(0, 100, 2); batch.cols[0].isNull[0] = true; batch.cols[0].noNulls = false; DoubleColumnVector out = (DoubleColumnVector) batch.cols[2]; out.noNulls = true; // set now so we can verify it changed - out.isRepeating = true; + out.isRepeating = true; expr.evaluate(batch); - + // verify NULL output in entry 0 is correct assertTrue(out.isNull[0]); assertTrue(Double.isNaN(out.vector[0])); - // check entries beyond first one + // check entries beyond first one for (int i = 1; i != batch.size; i++) { assertTrue(equalsWithinTolerance((i * 37) / 100d, out.vector[i])); } assertFalse(out.noNulls); assertFalse(out.isRepeating); } - - @Test + + @Test public void testScalarLongDivide() { - VectorizedRowBatch batch = + VectorizedRowBatch batch = TestVectorArithmeticExpressions.getVectorizedRowBatch2LongInDoubleOut(); LongScalarDivideLongColumn expr = new LongScalarDivideLongColumn(100, 0, 2); batch.cols[0].isNull[1] = true; @@ -203,15 +201,15 @@ public void testScalarLongDivide() { out.noNulls = true; // set now so we can verify it changed out.isRepeating = true; expr.evaluate(batch); - + // verify zero-divide result for position 0 assertTrue(Double.isInfinite(out.vector[0])); - + // verify NULL output in entry 1 is correct assertTrue(out.isNull[1]); assertTrue(Double.isNaN(out.vector[1])); - // check entries beyond 2nd one + // check entries beyond 2nd one for (int i = 2; i != batch.size; i++) { assertTrue(equalsWithinTolerance(100d / (i * 37), out.vector[i])); } diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTimestampExpressions.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTimestampExpressions.java index e8c7404..a088069 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTimestampExpressions.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTimestampExpressions.java @@ -21,6 +21,7 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.Calendar; +import java.util.List; import java.util.Random; import junit.framework.Assert; @@ -42,6 +43,9 @@ import org.apache.hadoop.io.LongWritable; import org.junit.Test; +/** + * Unit tests for timestamp expressions. + */ public class TestVectorTimestampExpressions { /* copied over from VectorUDFTimestampFieldLong */ @@ -63,7 +67,7 @@ private TimestampWritable toTimestampWritable(long nanos) { } private long[] getAllBoundaries() { - ArrayList boundaries = new ArrayList(1); + List boundaries = new ArrayList(1); Calendar c = Calendar.getInstance(); c.setTimeInMillis(0); // c.set doesn't reset millis for (int year = 1902; year <= 2038; year++) { @@ -126,7 +130,7 @@ private void verifyUDFYearLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } @@ -190,7 +194,7 @@ private void verifyUDFDayOfMonthLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } @@ -252,7 +256,7 @@ private void verifyUDFHourLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } @@ -314,7 +318,7 @@ private void verifyUDFMinuteLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } @@ -376,7 +380,7 @@ private void verifyUDFMonthLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } @@ -438,7 +442,7 @@ private void verifyUDFSecondLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } @@ -489,7 +493,8 @@ private void compareToUDFUnixTimeStampLong(long t, long y) { TimestampWritable tsw = toTimestampWritable(t); LongWritable res = udf.evaluate(tsw); if(res.get() != y) { - System.out.printf("%d vs %d for %d, %d\n", res.get(), y, t, tsw.getTimestamp().getTime()/1000); + System.out.printf("%d vs %d for %d, %d\n", res.get(), y, t, + tsw.getTimestamp().getTime()/1000); } Assert.assertEquals(res.get(), y); @@ -504,7 +509,7 @@ private void verifyUDFUnixTimeStampLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } @@ -566,7 +571,7 @@ private void verifyUDFWeekOfYearLong(VectorizedRowBatch batch) { Assert.assertEquals(batch.cols[in].noNulls, batch.cols[out].noNulls); for (int i = 0; i < batch.size; i++) { - if (batch.cols[in].noNulls || batch.cols[in].isNull[i] == false) { + if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) { if (!batch.cols[in].noNulls) { Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]); } diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/FakeVectorRowBatchFromObjectIterables.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/FakeVectorRowBatchFromObjectIterables.java index 579f931..c8eaea1 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/FakeVectorRowBatchFromObjectIterables.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/FakeVectorRowBatchFromObjectIterables.java @@ -41,7 +41,7 @@ private final VectorizedRowBatch batch; private boolean eof; private final int batchSize; - + public String[] getTypes() { return this.types; } @@ -49,9 +49,8 @@ /** * Helper interface for assigning values to primitive vector column types. */ - private static interface ColumnVectorAssign - { - public void assign( + private static interface ColumnVectorAssign { + void assign( ColumnVector columnVector, int row, Object value); @@ -109,7 +108,7 @@ public void assign( lcv.vector[row] = TimestampUtils.getTimeNanoSec(t); } }; - + } else if (types[i].equalsIgnoreCase("string")) { batch.cols[i] = new BytesColumnVector(batchSize); columnAssign[i] = new ColumnVectorAssign() { diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/VectorizedRowGroupGenUtil.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/VectorizedRowGroupGenUtil.java index 9aad077..238d40f 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/VectorizedRowGroupGenUtil.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/VectorizedRowGroupGenUtil.java @@ -24,7 +24,6 @@ import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; - public class VectorizedRowGroupGenUtil { private static final long LONG_VECTOR_NULL_VALUE = 1; @@ -73,9 +72,8 @@ public static LongColumnVector generateLongColumnVector( return lcv; } - public static DoubleColumnVector generateDoubleColumnVector( - boolean nulls, boolean repeating, int size, Random rand) - { + public static DoubleColumnVector generateDoubleColumnVector(boolean nulls, + boolean repeating, int size, Random rand) { DoubleColumnVector dcv = new DoubleColumnVector(size); dcv.noNulls = !nulls;