Repository: hive Updated Branches: refs/heads/branch-3 [created] f1f265046 refs/heads/branch-3.0.0 [deleted] f1f265046
http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/udf/VectorUDFAdaptor.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/udf/VectorUDFAdaptor.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/udf/VectorUDFAdaptor.java index 82b7a15..5b2cb4c 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/udf/VectorUDFAdaptor.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/udf/VectorUDFAdaptor.java @@ -60,6 +60,7 @@ public class VectorUDFAdaptor extends VectorExpression { private String resultType; private VectorUDFArgDesc[] argDescs; private ExprNodeGenericFuncDesc expr; + private boolean suppressEvaluateExceptions; private transient GenericUDF genericUDF; private transient GenericUDF.DeferredObject[] deferredChildren; @@ -84,6 +85,10 @@ public class VectorUDFAdaptor extends VectorExpression { this.argDescs = argDescs; } + public void setSuppressEvaluateExceptions(boolean suppressEvaluateExceptions) { + this.suppressEvaluateExceptions = suppressEvaluateExceptions; + } + // Initialize transient fields. To be called after deserialization of other fields. public void init() throws HiveException, UDFArgumentException { genericUDF = expr.getGenericUDF(); @@ -112,7 +117,7 @@ public class VectorUDFAdaptor extends VectorExpression { } @Override - public void evaluate(VectorizedRowBatch batch) { + public void evaluate(VectorizedRowBatch batch) throws HiveException { if (genericUDF == null) { try { @@ -192,7 +197,7 @@ public class VectorUDFAdaptor extends VectorExpression { /* Calculate the function result for row i of the batch and * set the output column vector entry i to the result. */ - private void setResult(int i, VectorizedRowBatch b) { + private void setResult(int i, VectorizedRowBatch b) throws HiveException { // get arguments for (int j = 0; j < argDescs.length; j++) { @@ -201,15 +206,19 @@ public class VectorUDFAdaptor extends VectorExpression { // call function Object result; - try { + if (!suppressEvaluateExceptions) { result = genericUDF.evaluate(deferredChildren); - } catch (HiveException e) { - - /* For UDFs that expect primitive types (like int instead of Integer or IntWritable), - * this will catch the the exception that happens if they are passed a NULL value. - * Then the default NULL handling logic will apply, and the result will be NULL. - */ - result = null; + } else { + try { + result = genericUDF.evaluate(deferredChildren); + } catch (HiveException e) { + + /* For UDFs that expect primitive types (like int instead of Integer or IntWritable), + * this will catch the the exception that happens if they are passed a NULL value. + * Then the default NULL handling logic will apply, and the result will be NULL. + */ + result = null; + } } // Set output column vector entry. Since we have one output column, the logical index = 0. http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java index e227f44..3860345 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestUnaryMinus.java @@ -25,6 +25,7 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColUnaryMinus; import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColUnaryMinusChecked; import org.apache.hadoop.hive.ql.exec.vector.util.VectorizedRowGroupGenUtil; +import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; import org.junit.Test; @@ -34,7 +35,7 @@ import org.junit.Test; public class TestUnaryMinus { @Test - public void testUnaryMinus() { + public void testUnaryMinus() throws HiveException { VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(1024, 2, 23); LongColUnaryMinus expr = new LongColUnaryMinus(0, 1); expr.evaluate(vrg); @@ -48,7 +49,7 @@ public class TestUnaryMinus { @Test - public void testUnaryMinusCheckedOverflow() { + public void testUnaryMinusCheckedOverflow() throws HiveException { VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(1, 2, 0); //set value to MIN_VALUE so that -MIN_VALUE overflows and gets set to MIN_VALUE again ((LongColumnVector)vrg.cols[0]).vector[0] = Integer.MIN_VALUE; @@ -64,7 +65,7 @@ public class TestUnaryMinus { } @Test - public void testUnaryMinusChecked() { + public void testUnaryMinusChecked() throws HiveException { VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(1024, 2, 23); LongColUnaryMinusChecked expr = new LongColUnaryMinusChecked(0, 1); expr.setOutputTypeInfo(TypeInfoFactory.getPrimitiveTypeInfo("bigint")); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java index f2adc08..f5491af 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java @@ -55,6 +55,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalScalarSubtra import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.DecimalScalarMultiplyDecimalColumn; import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.LongColAddLongScalarChecked; import org.apache.hadoop.hive.ql.exec.vector.util.VectorizedRowGroupGenUtil; +import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; import org.junit.Test; @@ -64,16 +65,16 @@ import org.junit.Test; public class TestVectorArithmeticExpressions { @Test - public void testLongColAddLongScalarNoNulls() { + public void testLongColAddLongScalarNoNulls() throws HiveException { longColAddLongScalarNoNulls(false); } @Test - public void testLongColAddLongScalarCheckedNoNulls() { + public void testLongColAddLongScalarCheckedNoNulls() throws HiveException { longColAddLongScalarNoNulls(true); } - private void longColAddLongScalarNoNulls(boolean checked) { + private void longColAddLongScalarNoNulls(boolean checked) throws HiveException { VectorizedRowBatch vrg = getVectorizedRowBatchSingleLongVector(VectorizedRowBatch.DEFAULT_SIZE); VectorExpression expr; if (checked) { @@ -122,16 +123,16 @@ public class TestVectorArithmeticExpressions { } @Test - public void testLongColAddLongScalarWithNulls() { + public void testLongColAddLongScalarWithNulls() throws HiveException { longColAddLongScalarCheckedWithNulls(false); } @Test - public void testLongColAddLongScalarCheckedWithNulls() { + public void testLongColAddLongScalarCheckedWithNulls() throws HiveException { longColAddLongScalarCheckedWithNulls(true); } - private void longColAddLongScalarCheckedWithNulls(boolean isChecked) { + private void longColAddLongScalarCheckedWithNulls(boolean isChecked) throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector( VectorizedRowBatch.DEFAULT_SIZE); LongColumnVector lcv = (LongColumnVector) batch.cols[0]; @@ -160,16 +161,16 @@ public class TestVectorArithmeticExpressions { } @Test - public void testLongColAddLongScalarWithRepeating() { + public void testLongColAddLongScalarWithRepeating() throws HiveException { longColAddLongScalarWithRepeatingUtil(false); } @Test - public void testLongColAddLongScalarCheckedWithRepeating() { + public void testLongColAddLongScalarCheckedWithRepeating() throws HiveException { longColAddLongScalarWithRepeatingUtil(true); } - private void longColAddLongScalarWithRepeatingUtil(boolean isChecked) { + private void longColAddLongScalarWithRepeatingUtil(boolean isChecked) throws HiveException { LongColumnVector in, out; VectorizedRowBatch batch; VectorExpression expr; @@ -248,16 +249,16 @@ public class TestVectorArithmeticExpressions { } @Test - public void testLongColAddLongColumn() { + public void testLongColAddLongColumn() throws HiveException { longColAddLongColumnUtil(false); } @Test - public void testLongColAddLongColumnChecked() { + public void testLongColAddLongColumnChecked() throws HiveException { longColAddLongColumnUtil(true); } - private void longColAddLongColumnUtil(boolean isChecked) { + private void longColAddLongColumnUtil(boolean isChecked) throws HiveException { int seed = 17; VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch( VectorizedRowBatch.DEFAULT_SIZE, @@ -348,7 +349,7 @@ public class TestVectorArithmeticExpressions { } @Test - public void testLongColDivideLongColumn() { + public void testLongColDivideLongColumn() throws HiveException { /* Testing for equality of doubles after a math operation is * not always reliable so use this as a tolerance. */ @@ -384,7 +385,7 @@ public class TestVectorArithmeticExpressions { } @Test - public void testLongColModuloLongColumn() { + public void testLongColModuloLongColumn() throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatch2LongInLongOut(); LongColModuloLongColumn expr = new LongColModuloLongColumn(0, 1, 2); batch.cols[0].isNull[1] = true; @@ -432,7 +433,7 @@ public class TestVectorArithmeticExpressions { } @Test - public void testDecimalColAddDecimalColumn() { + public void testDecimalColAddDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); VectorExpression expr = new DecimalColAddDecimalColumn(0, 1, 2); DecimalColumnVector r = (DecimalColumnVector) b.cols[2]; @@ -496,7 +497,7 @@ public class TestVectorArithmeticExpressions { // Spot check decimal column-column subtract @Test - public void testDecimalColSubtractDecimalColumn() { + public void testDecimalColSubtractDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); VectorExpression expr = new DecimalColSubtractDecimalColumn(0, 1, 2); DecimalColumnVector r = (DecimalColumnVector) b.cols[2]; @@ -518,7 +519,7 @@ public class TestVectorArithmeticExpressions { // Spot check decimal column-column multiply @Test - public void testDecimalColMultiplyDecimalColumn() { + public void testDecimalColMultiplyDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); VectorExpression expr = new DecimalColMultiplyDecimalColumn(0, 1, 2); DecimalColumnVector r = (DecimalColumnVector) b.cols[2]; @@ -544,7 +545,7 @@ public class TestVectorArithmeticExpressions { * cases used in the source code template ColumnArithmeticScalarDecimal.txt. */ @Test - public void testDecimalColAddDecimalScalar() { + public void testDecimalColAddDecimalScalar() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create(1); VectorExpression expr = new DecimalColAddDecimalScalar(0, d, 2); @@ -602,7 +603,7 @@ public class TestVectorArithmeticExpressions { * The template is used for division and modulo. */ @Test - public void testDecimalColDivideDecimalScalar() { + public void testDecimalColDivideDecimalScalar() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create("2.00"); VectorExpression expr = new DecimalColDivideDecimalScalar(0, d, 2); @@ -661,7 +662,7 @@ public class TestVectorArithmeticExpressions { * for template ScalarDivideColumnDecimal.txt. */ @Test - public void testDecimalScalarDivideDecimalColumn() { + public void testDecimalScalarDivideDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create("3.96"); // 1.20 * 3.30 VectorExpression expr = new DecimalScalarDivideDecimalColumn(d, 0, 2); @@ -708,7 +709,7 @@ public class TestVectorArithmeticExpressions { // Spot check Decimal Col-Scalar Modulo @Test - public void testDecimalColModuloDecimalScalar() { + public void testDecimalColModuloDecimalScalar() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create("2.00"); VectorExpression expr = new DecimalColModuloDecimalScalar(0, d, 2); @@ -744,7 +745,7 @@ public class TestVectorArithmeticExpressions { // Spot check decimal scalar-column modulo @Test - public void testDecimalScalarModuloDecimalColumn() { + public void testDecimalScalarModuloDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create("2.00"); VectorExpression expr = new DecimalScalarModuloDecimalColumn(d, 0, 2); @@ -771,7 +772,7 @@ public class TestVectorArithmeticExpressions { } @Test - public void testDecimalColDivideDecimalColumn() { + public void testDecimalColDivideDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); DecimalColumnVector in1 = (DecimalColumnVector) b.cols[1]; for (int i = 0; i < 3; i++) { @@ -848,7 +849,7 @@ public class TestVectorArithmeticExpressions { // Spot check decimal column modulo decimal column @Test - public void testDecimalColModuloDecimalColumn() { + public void testDecimalColModuloDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); DecimalColumnVector in1 = (DecimalColumnVector) b.cols[1]; for (int i = 0; i < 3; i++) { @@ -867,7 +868,7 @@ public class TestVectorArithmeticExpressions { * addition checks all the cases for the template, so don't do that redundantly here. */ @Test - public void testDecimalColSubtractDecimalScalar() { + public void testDecimalColSubtractDecimalScalar() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create(1); VectorExpression expr = new DecimalColSubtractDecimalScalar(0, d, 2); @@ -893,7 +894,7 @@ public class TestVectorArithmeticExpressions { * addition checks all the cases for the template, so don't do that redundantly here. */ @Test - public void testDecimalColMultiplyDecimalScalar() { + public void testDecimalColMultiplyDecimalScalar() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create(2); VectorExpression expr = new DecimalColMultiplyDecimalScalar(0, d, 2); @@ -919,7 +920,7 @@ public class TestVectorArithmeticExpressions { * cases used in the source code template ScalarArithmeticColumnDecimal.txt. */ @Test - public void testDecimalScalarAddDecimalColumn() { + public void testDecimalScalarAddDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create(1); VectorExpression expr = new DecimalScalarAddDecimalColumn(d, 0, 2); @@ -976,7 +977,7 @@ public class TestVectorArithmeticExpressions { * addition checks all the cases for the template, so don't do that redundantly here. */ @Test - public void testDecimalScalarSubtractDecimalColumn() { + public void testDecimalScalarSubtractDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create(1); VectorExpression expr = new DecimalScalarSubtractDecimalColumn(d, 0, 2); @@ -1003,7 +1004,7 @@ public class TestVectorArithmeticExpressions { */ @Test - public void testDecimalScalarMultiplyDecimalColumn() { + public void testDecimalScalarMultiplyDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols(); HiveDecimal d = HiveDecimal.create(2); VectorExpression expr = new DecimalScalarMultiplyDecimalColumn(d, 0, 2); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorConditionalExpressions.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorConditionalExpressions.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorConditionalExpressions.java index ea19e93..d02ae02 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorConditionalExpressions.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorConditionalExpressions.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.IfExprStringGroupColumn import org.apache.hadoop.hive.ql.exec.vector.expressions.IfExprStringGroupColumnStringScalar; import org.apache.hadoop.hive.ql.exec.vector.expressions.IfExprStringScalarStringGroupColumn; import org.apache.hadoop.hive.ql.exec.vector.expressions.IfExprStringScalarStringScalar; - +import org.apache.hadoop.hive.ql.metadata.HiveException; import org.junit.Test; /** @@ -175,7 +175,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testLongColumnColumnIfExpr() { + public void testLongColumnColumnIfExpr() throws HiveException { VectorizedRowBatch batch = getBatch4LongVectors(); VectorExpression expr = new IfExprLongColumnLongColumn(0, 1, 2, 3); expr.evaluate(batch); @@ -290,7 +290,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testDoubleColumnColumnIfExpr() { + public void testDoubleColumnColumnIfExpr() throws HiveException { // Just spot check because we already checked the logic for long. // The code is from the same template file. @@ -310,7 +310,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testLongColumnScalarIfExpr() { + public void testLongColumnScalarIfExpr() throws HiveException { VectorizedRowBatch batch = getBatch4LongVectors(); VectorExpression expr = new IfExprLongColumnLongScalar(0, 1, 100, 3); LongColumnVector r = (LongColumnVector) batch.cols[3]; @@ -322,7 +322,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testLongScalarColumnIfExpr() { + public void testLongScalarColumnIfExpr() throws HiveException { VectorizedRowBatch batch = getBatch4LongVectors(); VectorExpression expr = new IfExprLongScalarLongColumn(0, 100, 2, 3); LongColumnVector r = (LongColumnVector) batch.cols[3]; @@ -334,7 +334,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testLongScalarScalarIfExpr() { + public void testLongScalarScalarIfExpr() throws HiveException { VectorizedRowBatch batch = getBatch4LongVectors(); VectorExpression expr = new IfExprLongScalarLongScalar(0, 100, 200, 3); LongColumnVector r = (LongColumnVector) batch.cols[3]; @@ -346,7 +346,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testDoubleScalarScalarIfExpr() { + public void testDoubleScalarScalarIfExpr() throws HiveException { VectorizedRowBatch batch = getBatch1Long3DoubleVectors(); VectorExpression expr = new IfExprDoubleScalarDoubleScalar(0, 100.0d, 200.0d, 3); DoubleColumnVector r = (DoubleColumnVector) batch.cols[3]; @@ -358,7 +358,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testDoubleScalarColumnIfExpr() { + public void testDoubleScalarColumnIfExpr() throws HiveException { VectorizedRowBatch batch = getBatch1Long3DoubleVectors(); VectorExpression expr = new IfExprDoubleScalarDoubleColumn(0, 100.0d, 2, 3); DoubleColumnVector r = (DoubleColumnVector) batch.cols[3]; @@ -370,7 +370,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testDoubleColumnScalarIfExpr() { + public void testDoubleColumnScalarIfExpr() throws HiveException { VectorizedRowBatch batch = getBatch1Long3DoubleVectors(); VectorExpression expr = new IfExprDoubleColumnDoubleScalar(0, 1, 200d, 3); DoubleColumnVector r = (DoubleColumnVector) batch.cols[3]; @@ -382,7 +382,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testIfExprStringColumnStringColumn() { + public void testIfExprStringColumnStringColumn() throws HiveException { VectorizedRowBatch batch = getBatch1Long3BytesVectors(); VectorExpression expr = new IfExprStringGroupColumnStringGroupColumn(0, 1, 2, 3); BytesColumnVector r = (BytesColumnVector) batch.cols[3]; @@ -467,7 +467,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testIfExprStringColumnStringScalar() { + public void testIfExprStringColumnStringScalar() throws HiveException { VectorizedRowBatch batch = getBatch1Long3BytesVectors(); byte[] scalar = getUTF8Bytes("scalar"); VectorExpression expr = new IfExprStringGroupColumnStringScalar(0, 1, scalar, 3); @@ -490,7 +490,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testIfExprStringScalarStringColumn() { + public void testIfExprStringScalarStringColumn() throws HiveException { VectorizedRowBatch batch = getBatch1Long3BytesVectors(); byte[] scalar = getUTF8Bytes("scalar"); VectorExpression expr = new IfExprStringScalarStringGroupColumn(0,scalar, 2, 3); @@ -513,7 +513,7 @@ public class TestVectorConditionalExpressions { } @Test - public void testIfExprStringScalarStringScalar() { + public void testIfExprStringScalarStringScalar() throws HiveException { // standard case VectorizedRowBatch batch = getBatch1Long3BytesVectors(); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorDateExpressions.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorDateExpressions.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorDateExpressions.java index 9db91be..ffe9c81 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorDateExpressions.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorDateExpressions.java @@ -115,7 +115,7 @@ public class TestVectorDateExpressions { Assert.assertEquals(res.get(), y); } - private void verifyUDFYear(VectorizedRowBatch batch) { + private void verifyUDFYear(VectorizedRowBatch batch) throws HiveException { VectorExpression udf = null; udf = new VectorUDFYearDate(0, 1); udf.setInputTypeInfos(new TypeInfo[] {TypeInfoFactory.dateTypeInfo}); @@ -138,7 +138,7 @@ public class TestVectorDateExpressions { } @Test - public void testVectorUDFYear() { + public void testVectorUDFYear() throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatch(new int[] {0}, VectorizedRowBatch.DEFAULT_SIZE); Assert.assertTrue(((LongColumnVector) batch.cols[1]).noNulls); @@ -177,7 +177,7 @@ public class TestVectorDateExpressions { Assert.assertEquals(res.get(), y); } - private void verifyUDFDayOfMonth(VectorizedRowBatch batch) { + private void verifyUDFDayOfMonth(VectorizedRowBatch batch) throws HiveException { VectorExpression udf = null; udf = new VectorUDFDayOfMonthDate(0, 1); udf.setInputTypeInfos(new TypeInfo[] {TypeInfoFactory.dateTypeInfo}); @@ -200,7 +200,7 @@ public class TestVectorDateExpressions { } @Test - public void testVectorUDFDayOfMonth() { + public void testVectorUDFDayOfMonth() throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatch(new int[] {0}, VectorizedRowBatch.DEFAULT_SIZE); Assert.assertTrue(((LongColumnVector) batch.cols[1]).noNulls); @@ -239,7 +239,7 @@ public class TestVectorDateExpressions { Assert.assertEquals(res.get(), y); } - private void verifyUDFMonth(VectorizedRowBatch batch) { + private void verifyUDFMonth(VectorizedRowBatch batch) throws HiveException { VectorExpression udf; udf = new VectorUDFMonthDate(0, 1); udf.setInputTypeInfos(new TypeInfo[] {TypeInfoFactory.dateTypeInfo}); @@ -262,7 +262,7 @@ public class TestVectorDateExpressions { } @Test - public void testVectorUDFMonth() { + public void testVectorUDFMonth() throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatch(new int[] {0}, VectorizedRowBatch.DEFAULT_SIZE); Assert.assertTrue(((LongColumnVector) batch.cols[1]).noNulls); @@ -315,7 +315,7 @@ public class TestVectorDateExpressions { Assert.assertEquals(res.get(), y); } - private void verifyUDFUnixTimeStamp(VectorizedRowBatch batch) { + private void verifyUDFUnixTimeStamp(VectorizedRowBatch batch) throws HiveException { VectorExpression udf; udf = new VectorUDFUnixTimeStampDate(0, 1); udf.setInputTypeInfos(new TypeInfo[] {TypeInfoFactory.dateTypeInfo}); @@ -338,7 +338,7 @@ public class TestVectorDateExpressions { } @Test - public void testVectorUDFUnixTimeStamp() { + public void testVectorUDFUnixTimeStamp() throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatch(new int[] {0}, VectorizedRowBatch.DEFAULT_SIZE); Assert.assertTrue(((LongColumnVector) batch.cols[1]).noNulls); @@ -460,7 +460,7 @@ public class TestVectorDateExpressions { // 5s timeout @Test(timeout = 5000) - public void testMultiThreadedVectorUDFDate() { + public void testMultiThreadedVectorUDFDate() throws HiveException { List<Callable<Void>> tasks = new ArrayList<Callable<Void>>(); for (int i = 0; i < 200; i++) { tasks.add(new MultiThreadedDateFormatTest()); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java index 3e769bb..5f4d138 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorFilterExpressions.java @@ -65,7 +65,7 @@ import org.junit.Test; public class TestVectorFilterExpressions { @Test - public void testFilterLongColEqualLongScalar() { + public void testFilterLongColEqualLongScalar() throws HiveException { VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch(1024, 1, 23); FilterLongColEqualLongScalar expr = new FilterLongColEqualLongScalar(0, 46); @@ -75,7 +75,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterLongColGreaterLongColumn() { + public void testFilterLongColGreaterLongColumn() throws HiveException { int seed = 17; VectorizedRowBatch b = VectorizedRowGroupGenUtil.getVectorizedRowBatch( VectorizedRowBatch.DEFAULT_SIZE, @@ -132,7 +132,7 @@ public class TestVectorFilterExpressions { } @Test - public void testColOpScalarNumericFilterNullAndRepeatingLogic() { + public void testColOpScalarNumericFilterNullAndRepeatingLogic() throws HiveException { // No nulls, not repeating FilterLongColGreaterLongScalar f = new FilterLongColGreaterLongScalar(0, 1); VectorizedRowBatch batch = this.getSimpleLongBatch(); @@ -196,7 +196,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterLongColLessLongColumn() { + public void testFilterLongColLessLongColumn() throws HiveException { int seed = 17; VectorizedRowBatch vrg = VectorizedRowGroupGenUtil.getVectorizedRowBatch( 5, 3, seed); @@ -229,7 +229,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterLongScalarLessLongColumn() { + public void testFilterLongScalarLessLongColumn() throws HiveException { int seed = 17; VectorizedRowBatch vrb = VectorizedRowGroupGenUtil.getVectorizedRowBatch( 5, 2, seed); @@ -333,7 +333,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterLongBetween() { + public void testFilterLongBetween() throws HiveException { int seed = 17; VectorizedRowBatch vrb = VectorizedRowGroupGenUtil.getVectorizedRowBatch( 5, 2, seed); @@ -429,7 +429,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterLongNotBetween() { + public void testFilterLongNotBetween() throws HiveException { // Spot check only. null & repeating behavior are checked elsewhere for the same template. int seed = 17; @@ -452,7 +452,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterDoubleBetween() { + public void testFilterDoubleBetween() throws HiveException { // Spot check only. null & repeating behavior are checked elsewhere for the same template. int seed = 17; @@ -476,7 +476,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterDoubleNotBetween() { + public void testFilterDoubleNotBetween() throws HiveException { // Spot check only. null & repeating behavior are checked elsewhere for the same template. int seed = 17; @@ -514,7 +514,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterStringBetween() { + public void testFilterStringBetween() throws HiveException { int seed = 17; VectorizedRowBatch vrb = VectorizedRowGroupGenUtil.getVectorizedRowBatch( 3, 2, seed); @@ -566,7 +566,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterStringNotBetween() { + public void testFilterStringNotBetween() throws HiveException { // Spot check only. Non-standard cases are checked for the same template in another test. int seed = 17; @@ -589,7 +589,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterTimestampBetween() { + public void testFilterTimestampBetween() throws HiveException { VectorizedRowBatch vrb = new VectorizedRowBatch(1); vrb.cols[0] = new TimestampColumnVector(); @@ -614,7 +614,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterTimestampNotBetween() { + public void testFilterTimestampNotBetween() throws HiveException { VectorizedRowBatch vrb = new VectorizedRowBatch(1); vrb.cols[0] = new TimestampColumnVector(); @@ -775,7 +775,7 @@ public class TestVectorFilterExpressions { } @Test - public void testFilterStringIn() { + public void testFilterStringIn() throws HiveException { int seed = 17; VectorizedRowBatch vrb = VectorizedRowGroupGenUtil.getVectorizedRowBatch( 3, 2, seed); @@ -834,7 +834,7 @@ public class TestVectorFilterExpressions { * multiple cases because the logic is the same for <, >, <=, >=, == and !=. */ @Test - public void testFilterDecimalColEqualDecimalScalar() { + public void testFilterDecimalColEqualDecimalScalar() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol(); HiveDecimal scalar = HiveDecimal.create("-3.30"); VectorExpression expr = new FilterDecimalColEqualDecimalScalar(0, scalar); @@ -879,7 +879,7 @@ public class TestVectorFilterExpressions { * cases because the logic is the same for <, >, <=, >=, == and !=. */ @Test - public void testFilterDecimalScalarEqualDecimalColumn() { + public void testFilterDecimalScalarEqualDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol(); HiveDecimal scalar = HiveDecimal.create("-3.30"); VectorExpression expr = new FilterDecimalScalarEqualDecimalColumn(scalar, 0); @@ -924,7 +924,7 @@ public class TestVectorFilterExpressions { * cases because the logic is the same for <, >, <=, >=, == and !=. */ @Test - public void testFilterDecimalColumnEqualDecimalColumn() { + public void testFilterDecimalColumnEqualDecimalColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch2DecimalCol(); VectorExpression expr = new FilterDecimalColEqualDecimalColumn(0, 1); expr.evaluate(b); @@ -984,7 +984,7 @@ public class TestVectorFilterExpressions { * Spot check col < scalar for decimal. */ @Test - public void testFilterDecimalColLessScalar() { + public void testFilterDecimalColLessScalar() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol(); HiveDecimal scalar = HiveDecimal.create("0"); VectorExpression expr = new FilterDecimalColLessDecimalScalar(0, scalar); @@ -1000,7 +1000,7 @@ public class TestVectorFilterExpressions { * Spot check scalar > col for decimal. */ @Test - public void testFilterDecimalScalarGreaterThanColumn() { + public void testFilterDecimalScalarGreaterThanColumn() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch1DecimalCol(); HiveDecimal scalar = HiveDecimal.create("0"); VectorExpression expr = new FilterDecimalScalarGreaterDecimalColumn(scalar, 0); @@ -1016,7 +1016,7 @@ public class TestVectorFilterExpressions { * Spot check col >= col for decimal. */ @Test - public void testFilterDecimalColGreaterEqualCol() { + public void testFilterDecimalColGreaterEqualCol() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatch2DecimalCol(); VectorExpression expr = new FilterDecimalColGreaterEqualDecimalColumn(0, 1); expr.evaluate(b); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java index a60b9e4..50ad196 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java @@ -26,6 +26,7 @@ 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.VectorExpressionDescriptor.Descriptor; import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch; +import org.apache.hadoop.hive.ql.metadata.HiveException; import org.junit.Assert; import org.junit.Test; @@ -37,7 +38,7 @@ public class TestVectorLogicalExpressions { private static final int BOOLEAN_COLUMN_TEST_SIZE = 9; @Test - public void testLongColOrLongCol() { + public void testLongColOrLongCol() throws HiveException { VectorizedRowBatch batch = getBatchThreeBooleanCols(); ColOrCol expr = new ColOrCol(0, 1, 2); LongColumnVector outCol = (LongColumnVector) batch.cols[2]; @@ -92,7 +93,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testLongColAndLongCol() { + public void testLongColAndLongCol() throws HiveException { VectorizedRowBatch batch = getBatchThreeBooleanCols(); ColAndCol expr = new ColAndCol(0, 1, 2); LongColumnVector outCol = (LongColumnVector) batch.cols[2]; @@ -187,7 +188,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testBooleanNot() { + public void testBooleanNot() throws HiveException { VectorizedRowBatch batch = getBatchThreeBooleanCols(); NotCol expr = new NotCol(0, 2); LongColumnVector outCol = (LongColumnVector) batch.cols[2]; @@ -229,7 +230,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testIsNullExpr() { + public void testIsNullExpr() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = getBatchThreeBooleanCols(); IsNull expr = new IsNull(0, 2); @@ -269,7 +270,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testIsNotNullExpr() { + public void testIsNotNullExpr() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = getBatchThreeBooleanCols(); IsNotNull expr = new IsNotNull(0, 2); @@ -309,7 +310,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testBooleanFiltersOnColumns() { + public void testBooleanFiltersOnColumns() throws HiveException { VectorizedRowBatch batch = getBatchThreeBooleanCols(); SelectColumnIsTrue expr = new SelectColumnIsTrue(0); @@ -329,7 +330,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testSelectColumnIsNull() { + public void testSelectColumnIsNull() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = getBatchThreeBooleanCols(); SelectColumnIsNull expr = new SelectColumnIsNull(0); @@ -362,7 +363,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testSelectColumnIsNotNull() { + public void testSelectColumnIsNotNull() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = getBatchThreeBooleanCols(); SelectColumnIsNotNull expr = new SelectColumnIsNotNull(0); @@ -413,7 +414,7 @@ public class TestVectorLogicalExpressions { } @Override - public void evaluate(VectorizedRowBatch batch) { + public void evaluate(VectorizedRowBatch batch) throws HiveException { if (childExpressions != null) { super.evaluateChildren(batch); @@ -450,7 +451,7 @@ public class TestVectorLogicalExpressions { } @Override - public void evaluate(VectorizedRowBatch batch) { + public void evaluate(VectorizedRowBatch batch) throws HiveException { if (childExpressions != null) { super.evaluateChildren(batch); @@ -487,7 +488,7 @@ public class TestVectorLogicalExpressions { } @Override - public void evaluate(VectorizedRowBatch batch) { + public void evaluate(VectorizedRowBatch batch) throws HiveException { if (childExpressions != null) { super.evaluateChildren(batch); @@ -526,7 +527,7 @@ public class TestVectorLogicalExpressions { } @Override - public void evaluate(VectorizedRowBatch batch) { + public void evaluate(VectorizedRowBatch batch) throws HiveException { if (childExpressions != null) { super.evaluateChildren(batch); @@ -550,7 +551,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testFilterExprOrExpr() { + public void testFilterExprOrExpr() throws HiveException { VectorizedRowBatch batch1 = getBatchThreeBooleanCols(); VectorizedRowBatch batch2 = getBatchThreeBooleanCols(); @@ -591,7 +592,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testFilterExprMultiOrExpr() { + public void testFilterExprMultiOrExpr() throws HiveException { // Select all with the first expression and expect the other 2 children to not be invoked. @@ -719,7 +720,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testFilterExprOrExprWithBatchReuse() { + public void testFilterExprOrExprWithBatchReuse() throws HiveException { VectorizedRowBatch batch1 = getBatchThreeBooleanCols(); SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0); @@ -753,7 +754,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testFilterExprOrExprWithSelectInUse() { + public void testFilterExprOrExprWithSelectInUse() throws HiveException { VectorizedRowBatch batch1 = getBatchThreeBooleanCols(); SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0); @@ -783,7 +784,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testFilterExprAndExpr() { + public void testFilterExprAndExpr() throws HiveException { VectorizedRowBatch batch1 = getBatchThreeBooleanCols(); SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0); @@ -800,7 +801,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testLongInExpr() { + public void testLongInExpr() throws HiveException { // check basic operation VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchLongInLongOut(); @@ -831,7 +832,7 @@ public class TestVectorLogicalExpressions { } @Test - public void testDoubleInExpr() { + public void testDoubleInExpr() throws HiveException { // check basic operation VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDoubleInLongOut(); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java index a8f94e5..e81844c 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorMathFunctions.java @@ -69,7 +69,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorRound() { + public void testVectorRound() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); VectorExpression expr = new FuncRoundDoubleToDouble(0, 1); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; @@ -106,7 +106,7 @@ public class TestVectorMathFunctions { } @Test - public void testRoundToDecimalPlaces() { + public void testRoundToDecimalPlaces() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); VectorExpression expr = new RoundWithNumDigitsDoubleToDouble(0, 4, 1); expr.evaluate(b); @@ -357,7 +357,7 @@ public class TestVectorMathFunctions { * (for FuncRoundDoubleToDouble). */ @Test - public void testVectorSin() { + public void testVectorSin() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -367,7 +367,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorCos() { + public void testVectorCos() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -377,7 +377,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorTan() { + public void testVectorTan() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -387,7 +387,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorASin() { + public void testVectorASin() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -397,7 +397,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorACos() { + public void testVectorACos() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -407,7 +407,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorATan() { + public void testVectorATan() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -417,7 +417,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorDegrees() { + public void testVectorDegrees() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -427,7 +427,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorRadians() { + public void testVectorRadians() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -437,7 +437,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorFloor() { + public void testVectorFloor() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInLongOut(); LongColumnVector resultV = (LongColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -448,7 +448,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorCeil() { + public void testVectorCeil() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInLongOut(); LongColumnVector resultV = (LongColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -459,7 +459,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorExp() { + public void testVectorExp() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -469,7 +469,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorLn() { + public void testVectorLn() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); @@ -489,7 +489,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorLog2() { + public void testVectorLog2() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); @@ -509,7 +509,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorLog10() { + public void testVectorLog10() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); @@ -529,7 +529,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorRand() { + public void testVectorRand() throws HiveException { VectorizedRowBatch b = new VectorizedRowBatch(1); DoubleColumnVector v = new DoubleColumnVector(); b.cols[0] = v; @@ -565,7 +565,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorLogBase() { + public void testVectorLogBase() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); @@ -577,7 +577,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorPosMod() { + public void testVectorPosMod() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); @@ -620,7 +620,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorPosModWithFloatOutputType() { + public void testVectorPosModWithFloatOutputType() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); @@ -644,7 +644,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorPower() { + public void testVectorPower() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -654,7 +654,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorSqrt() { + public void testVectorSqrt() throws HiveException { VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -664,7 +664,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorAbs() { + public void testVectorAbs() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); @@ -686,7 +686,7 @@ public class TestVectorMathFunctions { } @Test - public void testVectorSign() { + public void testVectorSign() throws HiveException { // test double->double version VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut(); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java index d93aa3b..a246a45 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java @@ -28,6 +28,7 @@ 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.apache.hadoop.hive.ql.metadata.HiveException; import org.junit.Test; /** @@ -67,7 +68,7 @@ public class TestVectorScalarColArithmetic { } @Test - public void testLongScalarModuloLongColNoNulls() { + public void testLongScalarModuloLongColNoNulls() throws HiveException { VectorizedRowBatch batch = getBatchSingleLongVectorPositiveNonZero(); LongScalarModuloLongColumn expr = new LongScalarModuloLongColumn(100, 0, 1); expr.evaluate(batch); @@ -81,7 +82,7 @@ public class TestVectorScalarColArithmetic { } @Test - public void testLongScalarSubtractLongColNoNulls() { + public void testLongScalarSubtractLongColNoNulls() throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector( VectorizedRowBatch.DEFAULT_SIZE); LongScalarSubtractLongColumn expr = new LongScalarSubtractLongColumn(100, 0, 1); @@ -96,7 +97,7 @@ public class TestVectorScalarColArithmetic { } @Test - public void testLongScalarSubtractLongColWithNulls() { + public void testLongScalarSubtractLongColWithNulls() throws HiveException { VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector( VectorizedRowBatch.DEFAULT_SIZE); LongColumnVector lcv = (LongColumnVector) batch.cols[0]; @@ -119,7 +120,7 @@ public class TestVectorScalarColArithmetic { } @Test - public void testLongScalarSubtractLongColWithRepeating() { + public void testLongScalarSubtractLongColWithRepeating() throws HiveException { LongColumnVector in, out; VectorizedRowBatch batch; LongScalarSubtractLongColumn expr; @@ -167,7 +168,7 @@ public class TestVectorScalarColArithmetic { } @Test - public void testLongScalarDivide() { + public void testLongScalarDivide() throws HiveException { VectorizedRowBatch batch = TestVectorArithmeticExpressions.getVectorizedRowBatch2LongInDoubleOut(); LongColDivideLongScalar expr = new LongColDivideLongScalar(0, 100, 2); @@ -191,7 +192,7 @@ public class TestVectorScalarColArithmetic { } @Test - public void testScalarLongDivide() { + public void testScalarLongDivide() throws HiveException { VectorizedRowBatch batch = TestVectorArithmeticExpressions.getVectorizedRowBatch2LongInDoubleOut(); LongScalarDivideLongColumn expr = new LongScalarDivideLongColumn(100, 0, 2); @@ -219,7 +220,7 @@ public class TestVectorScalarColArithmetic { } @Test - public void testBooleanValuedLongIn() { + public void testBooleanValuedLongIn() throws HiveException { VectorizedRowBatch batch = getBatch(); long[] a = new long[2]; a[0] = 20; http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java index 202f18c..80dddcb 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorStringExpressions.java @@ -3222,7 +3222,7 @@ public class TestVectorStringExpressions { @Test // Test string column to string literal comparison - public void testStringColCompareStringScalarFilter() { + public void testStringColCompareStringScalarFilter() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; expr = new FilterStringGroupColEqualStringScalar(0, red2); @@ -3252,7 +3252,7 @@ public class TestVectorStringExpressions { @Test // Test string column to CHAR literal comparison - public void testStringColCompareCharScalarFilter() { + public void testStringColCompareCharScalarFilter() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; expr = new FilterStringGroupColEqualCharScalar(0, new HiveChar(new String(red2), 10)); @@ -3282,7 +3282,7 @@ public class TestVectorStringExpressions { @Test // Test string column to VARCHAR literal comparison - public void testStringColCompareVarCharScalarFilter() { + public void testStringColCompareVarCharScalarFilter() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; expr = new FilterStringGroupColEqualVarCharScalar(0, new HiveVarchar(new String(red2), 10)); @@ -3311,7 +3311,7 @@ public class TestVectorStringExpressions { } @Test - public void testStringColCompareStringScalarProjection() { + public void testStringColCompareStringScalarProjection() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; @@ -3334,7 +3334,7 @@ public class TestVectorStringExpressions { } @Test - public void testStringColCompareCharScalarProjection() { + public void testStringColCompareCharScalarProjection() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; @@ -3357,7 +3357,7 @@ public class TestVectorStringExpressions { } @Test - public void testStringColCompareVarCharScalarProjection() { + public void testStringColCompareVarCharScalarProjection() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; @@ -3381,7 +3381,7 @@ public class TestVectorStringExpressions { @Test // Test string literal to string column comparison - public void testStringScalarCompareStringCol() { + public void testStringScalarCompareStringCol() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; expr = new FilterStringScalarEqualStringGroupColumn(red2, 0); @@ -3411,7 +3411,7 @@ public class TestVectorStringExpressions { @Test // Test CHAR literal to string column comparison - public void testCharScalarCompareStringCol() { + public void testCharScalarCompareStringCol() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; expr = new FilterCharScalarEqualStringGroupColumn(new HiveChar(new String(red2), 8), 0); @@ -3441,7 +3441,7 @@ public class TestVectorStringExpressions { @Test // Test VARCHAR literal to string column comparison - public void testVarCharScalarCompareStringCol() { + public void testVarCharScalarCompareStringCol() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; expr = new FilterVarCharScalarEqualStringGroupColumn(new HiveVarchar(new String(red2), 8), 0); @@ -3470,7 +3470,7 @@ public class TestVectorStringExpressions { } @Test - public void testStringScalarCompareStringColProjection() { + public void testStringScalarCompareStringColProjection() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; @@ -3493,7 +3493,7 @@ public class TestVectorStringExpressions { } @Test - public void testCharScalarCompareStringColProjection() { + public void testCharScalarCompareStringColProjection() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; @@ -3516,7 +3516,7 @@ public class TestVectorStringExpressions { } @Test - public void testVarCharScalarCompareStringColProjection() { + public void testVarCharScalarCompareStringColProjection() throws HiveException { VectorizedRowBatch batch = makeStringBatch(); VectorExpression expr; @@ -3538,7 +3538,7 @@ public class TestVectorStringExpressions { Assert.assertEquals(0, outVector.vector[2]); } @Test - public void testStringColCompareStringColFilter() { + public void testStringColCompareStringColFilter() throws HiveException { VectorizedRowBatch batch; VectorExpression expr; @@ -3690,7 +3690,7 @@ public class TestVectorStringExpressions { } @Test - public void testStringColCompareStringColProjection() { + public void testStringColCompareStringColProjection() throws HiveException { VectorizedRowBatch batch; VectorExpression expr; long [] outVector; @@ -4029,7 +4029,7 @@ public class TestVectorStringExpressions { } @Test - public void testColLower() { + public void testColLower() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatchMixedCase(); StringLower expr = new StringLower(0, 1); @@ -4077,7 +4077,7 @@ public class TestVectorStringExpressions { } @Test - public void testColUpper() { + public void testColUpper() throws HiveException { // no nulls, not repeating @@ -4096,7 +4096,7 @@ public class TestVectorStringExpressions { } @Test - public void testStringLength() { + public void testStringLength() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatchMixedCharSize(); @@ -4435,7 +4435,7 @@ public class TestVectorStringExpressions { } @Test - public void testColConcatStringScalar() { + public void testColConcatStringScalar() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatch(); @@ -4497,7 +4497,7 @@ public class TestVectorStringExpressions { } @Test - public void testColConcatCharScalar() { + public void testColConcatCharScalar() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatch(); @@ -4559,7 +4559,7 @@ public class TestVectorStringExpressions { } @Test - public void testColConcatVarCharScalar() { + public void testColConcatVarCharScalar() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatch(); @@ -4621,7 +4621,7 @@ public class TestVectorStringExpressions { } @Test - public void testStringScalarConcatCol() { + public void testStringScalarConcatCol() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatch(); @@ -4683,7 +4683,7 @@ public class TestVectorStringExpressions { } @Test - public void testCharScalarConcatCol() { + public void testCharScalarConcatCol() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatch(); @@ -4745,7 +4745,7 @@ public class TestVectorStringExpressions { } @Test - public void testVarCharScalarConcatCol() { + public void testVarCharScalarConcatCol() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatch(); @@ -4807,7 +4807,7 @@ public class TestVectorStringExpressions { } @Test - public void testColConcatCol() { + public void testColConcatCol() throws HiveException { // has nulls, not repeating VectorizedRowBatch batch = makeStringBatch2In1Out(); @@ -4949,7 +4949,7 @@ public class TestVectorStringExpressions { } @Test - public void testSubstrStart() throws UnsupportedEncodingException { + public void testSubstrStart() throws HiveException, UnsupportedEncodingException { // Testing no nulls and no repeating VectorizedRowBatch batch = new VectorizedRowBatch(2); BytesColumnVector v = new BytesColumnVector(); @@ -5148,7 +5148,7 @@ public class TestVectorStringExpressions { } @Test - public void testSubstrStartLen() throws UnsupportedEncodingException { + public void testSubstrStartLen() throws HiveException, UnsupportedEncodingException { // Testing no nulls and no repeating VectorizedRowBatch batch = new VectorizedRowBatch(2); @@ -5403,7 +5403,7 @@ public class TestVectorStringExpressions { } @Test - public void testVectorLTrim() { + public void testVectorLTrim() throws HiveException { VectorizedRowBatch b = makeTrimBatch(); VectorExpression expr = new StringLTrim(0, 1); expr.evaluate(b); @@ -5423,7 +5423,7 @@ public class TestVectorStringExpressions { } @Test - public void testVectorRTrim() { + public void testVectorRTrim() throws HiveException { VectorizedRowBatch b = makeTrimBatch(); VectorExpression expr = new StringRTrim(0, 1); expr.evaluate(b); @@ -5443,7 +5443,7 @@ public class TestVectorStringExpressions { } @Test - public void testVectorTrim() { + public void testVectorTrim() throws HiveException { VectorizedRowBatch b = makeTrimBatch(); VectorExpression expr = new StringTrim(0, 1); expr.evaluate(b); @@ -5481,7 +5481,7 @@ public class TestVectorStringExpressions { // Test boolean-valued (non-filter) IN expression for strings @Test - public void testStringInExpr() { + public void testStringInExpr() throws HiveException { // test basic operation VectorizedRowBatch b = makeStringBatch(); http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java index 6aa6da9..3f17d4c 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java @@ -58,7 +58,7 @@ import org.junit.Test; public class TestVectorTypeCasts { @Test - public void testVectorCastLongToDouble() { + public void testVectorCastLongToDouble() throws HiveException { VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchLongInDoubleOut(); DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -68,7 +68,7 @@ public class TestVectorTypeCasts { } @Test - public void testVectorCastDoubleToLong() { + public void testVectorCastDoubleToLong() throws HiveException { VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDoubleInLongOut(); LongColumnVector resultV = (LongColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -78,7 +78,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastDateToTimestamp() { + public void testCastDateToTimestamp() throws HiveException { int[] intValues = new int[500]; VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDateInTimestampOut(intValues); TimestampColumnVector resultV = (TimestampColumnVector) b.cols[1]; @@ -93,7 +93,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastDoubleToBoolean() { + public void testCastDoubleToBoolean() throws HiveException { VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDoubleInLongOut(); LongColumnVector resultV = (LongColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -104,7 +104,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastDoubleToTimestamp() { + public void testCastDoubleToTimestamp() throws HiveException { VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDoubleInTimestampOut(); TimestampColumnVector resultV = (TimestampColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -115,7 +115,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastLongToBoolean() { + public void testCastLongToBoolean() throws HiveException { VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchLongInLongOut(); LongColumnVector inV = (LongColumnVector) b.cols[0]; inV.vector[0] = 0; // make one entry produce false in result @@ -128,7 +128,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastStringToBoolean() { + public void testCastStringToBoolean() throws HiveException { VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchStringInLongOut(); LongColumnVector resultV = (LongColumnVector) b.cols[1]; b.cols[0].noNulls = true; @@ -145,7 +145,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastLongToTimestamp() { + public void testCastLongToTimestamp() throws HiveException { long[] longValues = new long[500]; VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchLongInTimestampOut(longValues); TimestampColumnVector resultV = (TimestampColumnVector) b.cols[1]; @@ -160,7 +160,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastTimestampToLong() { + public void testCastTimestampToLong() throws HiveException { long[] longValues = new long[500]; VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchTimestampInLongOut(longValues); TimestampColumnVector inV = (TimestampColumnVector) b.cols[0]; @@ -178,7 +178,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastTimestampToDouble() { + public void testCastTimestampToDouble() throws HiveException { double[] doubleValues = new double[500]; VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchTimestampInDoubleOut(doubleValues); TimestampColumnVector inV = (TimestampColumnVector) b.cols[0]; @@ -219,7 +219,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastBooleanToString() { + public void testCastBooleanToString() throws HiveException { byte[] t = toBytes("TRUE"); byte[] f = toBytes("FALSE"); VectorizedRowBatch b = TestVectorMathFunctions.getBatchForStringMath(); @@ -319,7 +319,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastDecimalToDouble() { + public void testCastDecimalToDouble() throws HiveException { final double eps = 0.000001d; // tolerance to check double equality @@ -422,7 +422,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastDecimalToTimestamp() { + public void testCastDecimalToTimestamp() throws HiveException { double[] doubleValues = new double[500]; VectorizedRowBatch b = getBatchDecimalTimestamp(doubleValues); VectorExpression expr = new CastDecimalToTimestamp(0, 1); @@ -477,7 +477,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastLongToDecimal() { + public void testCastLongToDecimal() throws HiveException { VectorizedRowBatch b = getBatchLongDecimal(); VectorExpression expr = new CastLongToDecimal(0, 1); expr.evaluate(b); @@ -540,7 +540,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastDoubleToDecimal() { + public void testCastDoubleToDecimal() throws HiveException { VectorizedRowBatch b = getBatchDoubleDecimal(); VectorExpression expr = new CastDoubleToDecimal(0, 1); expr.evaluate(b); @@ -577,7 +577,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastStringToDecimal() { + public void testCastStringToDecimal() throws HiveException { VectorizedRowBatch b = getBatchStringDecimal(); VectorExpression expr = new CastStringToDecimal(0, 1); expr.evaluate(b); @@ -607,7 +607,7 @@ public class TestVectorTypeCasts { } @Test - public void testCastTimestampToDecimal() { + public void testCastTimestampToDecimal() throws HiveException { // The input timestamps are stored as long values // measured in nanoseconds from the epoch. http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/udf/TestVectorUDFAdaptor.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/udf/TestVectorUDFAdaptor.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/udf/TestVectorUDFAdaptor.java index 7e512ba..46834d8 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/udf/TestVectorUDFAdaptor.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/udf/TestVectorUDFAdaptor.java @@ -61,7 +61,7 @@ public class TestVectorUDFAdaptor { } @Test - public void testLongUDF() { + public void testLongUDF() throws HiveException { // create a syntax tree for a simple function call "longudf(col0)" ExprNodeGenericFuncDesc funcDesc; @@ -124,7 +124,7 @@ public class TestVectorUDFAdaptor { } @Test - public void testMultiArgumentUDF() { + public void testMultiArgumentUDF() throws HiveException { // create a syntax tree for a function call "testudf(col0, col1, col2)" ExprNodeGenericFuncDesc funcDesc; @@ -246,7 +246,7 @@ public class TestVectorUDFAdaptor { // test the UDF adaptor for a generic UDF (as opposed to a legacy UDF) @Test - public void testGenericUDF() { + public void testGenericUDF() throws HiveException { // create a syntax tree for a function call 'myisnull(col0, "UNKNOWN")' ExprNodeGenericFuncDesc funcDesc; http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/queries/clientpositive/vector_retry_failure.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/vector_retry_failure.q b/ql/src/test/queries/clientpositive/vector_retry_failure.q new file mode 100644 index 0000000..448af73 --- /dev/null +++ b/ql/src/test/queries/clientpositive/vector_retry_failure.q @@ -0,0 +1,15 @@ +--! qt:dataset:src + +SET hive.vectorized.execution.enabled=true; +create table tx(a int,f string); +insert into tx values (1,'non_existent_file'); + +set zzz=1; +set reexec.overlay.zzz=2; + +set hive.query.reexecution.enabled=true; +set hive.query.reexecution.strategies=overlay; + +explain vectorization expression +select assert_true(${hiveconf:zzz} > a) from tx group by a; +select assert_true(${hiveconf:zzz} > a) from tx group by a; http://git-wip-us.apache.org/repos/asf/hive/blob/71be5ace/ql/src/test/results/clientpositive/llap/vector_retry_failure.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/llap/vector_retry_failure.q.out b/ql/src/test/results/clientpositive/llap/vector_retry_failure.q.out new file mode 100644 index 0000000..7bb21a4 --- /dev/null +++ b/ql/src/test/results/clientpositive/llap/vector_retry_failure.q.out @@ -0,0 +1,160 @@ +PREHOOK: query: create table tx(a int,f string) +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@tx +POSTHOOK: query: create table tx(a int,f string) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@tx +PREHOOK: query: insert into tx values (1,'non_existent_file') +PREHOOK: type: QUERY +PREHOOK: Input: _dummy_database@_dummy_table +PREHOOK: Output: default@tx +POSTHOOK: query: insert into tx values (1,'non_existent_file') +POSTHOOK: type: QUERY +POSTHOOK: Input: _dummy_database@_dummy_table +POSTHOOK: Output: default@tx +POSTHOOK: Lineage: tx.a SCRIPT [] +POSTHOOK: Lineage: tx.f SCRIPT [] +PREHOOK: query: explain vectorization expression +select assert_true(1 > a) from tx group by a +PREHOOK: type: QUERY +POSTHOOK: query: explain vectorization expression +select assert_true(1 > a) from tx group by a +POSTHOOK: type: QUERY +PLAN VECTORIZATION: + enabled: true + enabledConditionsMet: [hive.vectorized.execution.enabled IS true] + +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: tx + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE + TableScan Vectorization: + native: true + Select Operator + expressions: a (type: int) + outputColumnNames: a + Select Vectorization: + className: VectorSelectOperator + native: true + projectedOutputColumnNums: [0] + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE + Group By Operator + Group By Vectorization: + className: VectorGroupByOperator + groupByMode: HASH + keyExpressions: col 0:int + native: false + vectorProcessingMode: HASH + projectedOutputColumnNums: [] + keys: a (type: int) + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE + Reduce Output Operator + key expressions: _col0 (type: int) + sort order: + + Map-reduce partition columns: _col0 (type: int) + Reduce Sink Vectorization: + className: VectorReduceSinkLongOperator + native: true + nativeConditionsMet: hive.vectorized.execution.reducesink.new.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, No PTF TopN IS true, No DISTINCT columns IS true, BinarySortableSerDe for keys IS true, LazyBinarySerDe for values IS true + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map Vectorization: + enabled: true + enabledConditionsMet: hive.vectorized.use.vector.serde.deserialize IS true + inputFormatFeatureSupport: [DECIMAL_64] + vectorizationSupportRemovedReasons: [DECIMAL_64 disabled because LLAP is enabled] + featureSupportInUse: [] + inputFileFormats: org.apache.hadoop.mapred.TextInputFormat + allNative: false + usesVectorUDFAdaptor: false + vectorized: true + Reducer 2 + Execution mode: vectorized, llap + Reduce Vectorization: + enabled: true + enableConditionsMet: hive.vectorized.execution.reduce.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true + allNative: false + usesVectorUDFAdaptor: true + vectorized: true + Reduce Operator Tree: + Group By Operator + Group By Vectorization: + className: VectorGroupByOperator + groupByMode: MERGEPARTIAL + keyExpressions: col 0:int + native: false + vectorProcessingMode: MERGE_PARTIAL + projectedOutputColumnNums: [] + keys: KEY._col0 (type: int) + mode: mergepartial + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE + Select Operator + expressions: assert_true((_col0 < 1)) (type: void) + outputColumnNames: _col0 + Select Vectorization: + className: VectorSelectOperator + native: true + projectedOutputColumnNums: [2] + selectExpressions: VectorUDFAdaptor(assert_true((_col0 < 1)))(children: LongColLessLongScalar(col 0:int, val 1) -> 1:boolean) -> 2:void + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE + File Output Operator + compressed: false + File Sink Vectorization: + className: VectorFileSinkOperator + native: false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select assert_true(1 > a) from tx group by a +PREHOOK: type: QUERY +PREHOOK: Input: default@tx +#### A masked pattern was here #### +Status: Failed +Vertex failed, vertexName=Reducer 2, vertexId=vertex_#ID#, diagnostics=[Task failed, taskId=task_#ID#, diagnostics=[TaskAttempt 0 failed, info=[Error: Error while running task ( failure ) : attempt_#ID#:java.lang.RuntimeException: java.lang.RuntimeException: Hive Runtime Error while closing operators: ASSERT_TRUE(): assertion failed. +#### A masked pattern was here #### +], TaskAttempt 1 failed, info=[Error: Error while running task ( failure ) : attempt_#ID#:java.lang.RuntimeException: java.lang.RuntimeException: Hive Runtime Error while closing operators: ASSERT_TRUE(): assertion failed. +#### A masked pattern was here #### +]], Vertex did not succeed due to OWN_TASK_FAILURE, failedTasks:1 killedTasks:0, Vertex vertex_#ID# [Reducer 2] killed/failed due to:OWN_TASK_FAILURE] +DAG did not succeed due to VERTEX_FAILURE. failedVertices:1 killedVertices:0 +FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Reducer 2, vertexId=vertex_#ID#, diagnostics=[Task failed, taskId=task_#ID#, diagnostics=[TaskAttempt 0 failed, info=[Error: Error while running task ( failure ) : attempt_#ID#:java.lang.RuntimeException: java.lang.RuntimeException: Hive Runtime Error while closing operators: ASSERT_TRUE(): assertion failed. +#### A masked pattern was here #### +], TaskAttempt 1 failed, info=[Error: Error while running task ( failure ) : attempt_#ID#:java.lang.RuntimeException: java.lang.RuntimeException: Hive Runtime Error while closing operators: ASSERT_TRUE(): assertion failed. +#### A masked pattern was here #### +]], Vertex did not succeed due to OWN_TASK_FAILURE, failedTasks:1 killedTasks:0, Vertex vertex_#ID# [Reducer 2] killed/failed due to:OWN_TASK_FAILURE]DAG did not succeed due to VERTEX_FAILURE. failedVertices:1 killedVertices:0 +PREHOOK: query: select assert_true(2 > a) from tx group by a +PREHOOK: type: QUERY +PREHOOK: Input: default@tx +#### A masked pattern was here #### +POSTHOOK: query: select assert_true(2 > a) from tx group by a +POSTHOOK: type: QUERY +POSTHOOK: Input: default@tx +#### A masked pattern was here #### +NULL
